September 2016
Intermediate to advanced
408 pages
9h 18m
English
Like all general-purpose programming languages, Haskell too has a few different number types. Unlike other languages, the number types in Haskell are organized into a hierarchy via type classes. This gives us two things:
An example of an insane thing would be dividing an integer by another integer, expecting an integer as a result. And because every integral type is an instance of the Integral class, we can easily write a factorial function that doesn't care what the underlying type is (as long as it represents an integer):
factorial :: Integral a => a -> a factorial n = ...
Read now
Unlock full access