Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
enobayram
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
enobayram
7y ago
Though I should add that it's in general against the Haskell spirit to write code against needlessly specific types and to combine unrelated functionality. So, I'd first look for a function or write one myself in some utils module
2.
▲
by
enobayram
7y ago
here's ho I'd write it: getSocketAPIPort :: Int -> IO Int getSocketAPIPort defaultPort = readWithDefault <$> lookupEnv "socketPort" where readWithDefault mbPort = fromMaybe defaultPort $