2020-01-01から1年間の記事一覧
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…
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…