[Haskell-cafe] Re: [Haskell] The initial view on typed sprintf and sscanf

2008-09-02 Thread ChrisK
Matthew Brecknell wrote: Unfortunately, I don't seem to be able to make the expected fprintf function, because printf's format-dependent parameter list makes it impossible to find a place to pass the handle. Hence the C++-like () ugliness. How about this: fprintf :: Handle - F (IO ()) b -

[Haskell-cafe] Re: [Haskell] The initial view on typed sprintf and sscanf

2008-09-01 Thread Matthew Brecknell
oleg [1]: We demonstrate typed sprintf and typed sscanf sharing the same formatting specification. [1]http://www.haskell.org/pipermail/haskell/2008-August/020605.html Reading Oleg's post, I noticed that it is quite straightforward to generalise printing to arbitrary output types. class

Re: [Haskell-cafe] Re: [Haskell] The initial view on typed sprintf and sscanf

2008-09-01 Thread Don Stewart
haskell: oleg [1]: We demonstrate typed sprintf and typed sscanf sharing the same formatting specification. [1]http://www.haskell.org/pipermail/haskell/2008-August/020605.html Reading Oleg's post, I noticed that it is quite straightforward to generalise printing to arbitrary output

Re: [Haskell-cafe] Re: [Haskell] The initial view on typed sprintf and sscanf

2008-09-01 Thread Ryan Ingram
On Mon, Sep 1, 2008 at 1:00 AM, Don Stewart [EMAIL PROTECTED] wrote: I also wonder if we could give a String syntax to the formatting language, using -XOverloadedStrings and the IsString class. Probably easier with Template Haskell: ghci -fth Sprintf.hs *Sprintf :t $(sprintf Hello %s, showing

Re[2]: [Haskell-cafe] Re: [Haskell] The initial view on typed sprintf and sscanf

2008-09-01 Thread Bulat Ziganshin
Hello Ryan, Monday, September 1, 2008, 12:16:46 PM, you wrote: of course this may be done with code generation tools (such as TH). point of this research is to do this using type abilities of Haskell Don, i think this should be impossible with IsString since the point is that Haskell compiler

Re: Re[2]: [Haskell-cafe] Re: [Haskell] The initial view on typed sprintf and sscanf

2008-09-01 Thread Ryan Ingram
On Mon, Sep 1, 2008 at 1:30 AM, Bulat Ziganshin [EMAIL PROTECTED] wrote: of course this may be done with code generation tools (such as TH). point of this research is to do this using type abilities of Haskell Yes, I know. My point was that TH could be used as a minimal String - ExpQ wrapper,