Are there “type-level combinators”? Will they exist in some future?

前端 未结 3 885
不思量自难忘°
不思量自难忘° 2020-12-31 03:47

Much of what makes haskell really nice to use in my opinion are combinators such as (.), flip, $ <*> and etc. It fe

3条回答
  •  感动是毒
    2020-12-31 04:29

    I'm writing answer here just for clarifying things and to tell about achievements in the last years. There're a lot of features in Haskell and now you can write some operators in type. Using $ you can write something like this:

    foo :: Int -> Either String $ Maybe $ Maybe Int
    

    to avoid parenthesis instead of good old

    foo :: Int -> Either String (Maybe (Maybe Int))
    

提交回复
热议问题