What does () mean in Haskell

前端 未结 4 1574
鱼传尺愫
鱼传尺愫 2020-12-06 11:21

In some Haskell code I came across:

put :: s -> m ()

What does the () mean here?

I\'d use a search engine, but I ca

4条回答
  •  一向
    一向 (楼主)
    2020-12-06 11:33

    It's called the "unit type". You can think of it as Haskell's equivalent of void, in some respects. It's a type that has only one value (also ()).

提交回复
热议问题