Text.Printf replacement?

Bart Massey bart at cs.pdx.edu
Fri Sep 6 19:56:55 CEST 2013


TypeFamilies are kind of heavy machinery here :-), but since it would
be confined to the library and seems to solve the problem, I'd be in
favor of doing as you suggest. We can conditionally compile if we are
worried about non-GHC implementations, I think. Do other folks have an
opinion? --Bart

On Fri, Sep 6, 2013 at 8:18 AM, Twan van Laarhoven <twanvl at gmail.com> wrote:
> On 06/09/13 04:16, Bart Massey wrote:
>>
>> A final issue has to do with the return type of Text.Printf.printf,
>> which is polymorphic between String and IO a. I'm sure this seemed
>> like a good idea at the time, but it's not so ideal today: GHC gives a
>> warning when printf is used at IO a unless you explicitly ignore the
>> result.
>
>
> You can probably force the `a` to be `()` by using:
>
>     instance (a ~ ()) => PrintfType (IO a) where ...
>
> But that is of course not standard Haskell.
>
>
> Twan
>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries




More information about the Libraries mailing list