2020-01-01から1ヶ月間の記事一覧

Chap 4 | Syntax in Functions

learnyouahaskell.com Pattern matching With pattern matching, you can check if a data conforms some specification and deconstruct the data. A function can have several bodies for different patterns. The below function checks if its paramete…

Chap 3 | Types and Typeclasses

learnyouahaskell.com Believe the type We can get a type of expressions with :t command in GHCi. ghci> :t 'a' 'a' :: Char :: is read as "has type of". In the example above, Haskell says "'a' has type of Char". Explicit types are always deno…