Closed
Description
Tutorials : Chapter 3
In the first example of Selective Receive this line won't typecheck:
mapM_ (say . show) [first, second, third]
because the types of first, second and third
are not the same.
first :: String
second :: Maybe String -- (corrected in PR#35)
third :: ProcessId
A possible simple solution would be to manually use
(say.show) first
(say.show) second
(say.show) third
Or otherwise construct a heterogenous lists(using GADTs or existential quantification) and then use mapM_
which seems cumbersome and unnecessary.
Metadata
Metadata
Assignees
Labels
No labels