Examples of Haskell Applicative Transformers

后端 未结 4 551
别跟我提以往
别跟我提以往 2021-02-08 06:41

The wiki on www.haskell.org tells us the following about Applicative Transformers:

So where are applicative transformers? The answer is, that we do not ne

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-08 07:16

    Saying they can be combined in a generic way does not mean they can be combined implicitly or invisibly or anything like that. =)

    You still need to write a bit of code, either by using different mungers than <*> and pure or by adding some newtype noise. For example, using the TypeCompose package, you might write

    test2 = ex (O (Just "abc")) [O (Just "pqr"), O (Just "xyz")]
    

提交回复
热议问题