Type Level "Application" Operator

Ryan Scott ryan.gl.scott at gmail.com
Wed Nov 2 15:33:57 UTC 2016


> But this makes me wonder, is it actually *impossible* in Haskell to export from the same module a function with the same name at both the value and type level? Is it possible to export only one of the two?

It's quite possible. You just have to use the "type" namespace in your
export list to disambiguate the term-level and type-level ($)s:

    {-# LANGUAGE TypeOperators #-}
    module Money (($), type ($)) where

    type f $ x = f x
    infixr 0 $

Also, +1 on the original suggestion to add ($) to base.

Ryan S.


More information about the Libraries mailing list