Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 480 Bytes

types_intro.md

File metadata and controls

3 lines (2 loc) · 480 Bytes

Type parameters

You will often encounter types like Maybe a or Either Text a. The lowercase variables are type parameters – any other type can be substituted for them. So if you have an expression of type Either Text a, it can serve as Either Text Int, Either Text (List Text) or Either Text (Maybe a). Note that this substitution happens once for all the occurrences of a variable, so id :: a -> a can become id :: Int -> Int, but not id :: Double -> Int.