/haskell_practice

Primary LanguageHaskellISC LicenseISC

haskell_practice

References

Notes

  • Type classes
    • Eq is used for types that support equality testing. The functions its members implement are == and /=
    • Ord is for types that have an ordering. Ord covers all the standard comparing functions such as >, <, >= and <=
    • Ordering is a type that can be GT, LT or EQ
    • Members of Show can be presented as strings
    • Read is sort of the opposite typeclass of Show
    • Enum members are sequentially ordered types — they can be enumerated. The main advantage of the Enum typeclass is that we can use its types in list ranges
    • Bounded members have an upper and a lower bound
    • Num is a numeric typeclass. To join Num, a type must already be friends with Show and Eq
    • Integral is also a numeric typeclass. Integral includes only integral (whole) numbers. In this typeclass are Int and Integer
    • Floating includes only floating point numbers, so Float and Double.