Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
tobz619
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
tobz619
2y ago
There's a difference between empty strings and Null values imo. Just "" != Nothing If you want to handle empty strings as a input in haskell then you have a function of type `f :: String -> b` and you pattern match on your
2.
▲
by
tobz619
2y ago
Haskell also has GADTs: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/gadt... , firstly as an extension and now it's built into the latest version of this year's compiler
3.
▲
by
tobz619
2y ago
It can using pure or return or if working with just Maybe specifically then Maybe is defined like so: data Maybe a = Just a | Nothing So to make an X a Maybe X, you'd put a Just before a value of type X. For example: one :: Int one = 1
4.
▲
by
tobz619
2y ago
If you have a value "aValue :: a" and a monadic function of "mFunc :: (a -> Maybe b)" that's essentially just asking you to use `>>= :: Maybe a -> (a -> Maybe b) -> Maybe b` as well as `pure :: App