Re: [Haskell-cafe] How helpful is h-99 (and should we complete the missing ones)?

2012-04-15 Thread Daniel Hlynskyi
So here's my question: how useful is h-99 (are they overrated as learning tools)? I find myself solve most of them in a from the scratch fashion (e.g., no Monad, no Applicative, no Functor aside from List and a few Maybe). Some of them are paper-worthy, for example the prime problems. I hope

Re: [Haskell-cafe] [Haskell] ANNOUNCE: notcpp-0.0.1

2012-04-15 Thread Steffen Schuldenzucker
On 04/13/2012 10:49 PM, Ben Millwood wrote: I'm pleased to announce my first genuinely original Hackage package: notcpp-0.0.1! http://hackage.haskell.org/package/notcpp [...] Why is it scopeLookup :: String - Q Exp with n bound to x :: T = @scopeLookup n@ evaluates to an Exp containing

Re: [Haskell-cafe] How helpful is h-99 (and should we complete the missing ones)?

2012-04-15 Thread Brandon Allbery
On Sun, Apr 15, 2012 at 09:58, Daniel Hlynskyi abcz2.upr...@gmail.comwrote: And of-course, problems and solutions are not annotated with there typical real world aplications, they are not obvious for average beginners. Why would I make Binary tree balanced, when I don't know, what I'll gain

[Haskell-cafe] strange GHCi type inference behavior involving map and partially applied functions

2012-04-15 Thread Ting Lei
Hi All, I found a really strange case where GHC and GHCi behave differently in inferring types. It took me hours to figure this out. The following program {-# LANGUAGE NoMonomorphismRestriction #-} g x i = x ++ show i [a,b] = map g [X,Y] will not load without NoMonomorphismRestriction.

Re: [Haskell-cafe] strange GHCi type inference behavior involving map and partially applied functions

2012-04-15 Thread Erik Hesselink
GHCi is defaulting the 'a' in 'Show a' to unit because of the extended defaulting feature [1] in GHCi. If you turn on NoMonomorphismRestriction in GHCi, you get the same behavior as in GHC. If you turn on ExtendedDefaulting in GHC, you get the same behavior as in GHCi. Erik [1]

Re: [Haskell-cafe] Conduit Best Practices for leftover data

2012-04-15 Thread Myles C. Maxfield
Thanks for responding to this. Some responses are inline. On Sat, Apr 14, 2012 at 8:30 PM, Michael Snoyman mich...@snoyman.com wrote: On Thu, Apr 12, 2012 at 9:25 AM, Myles C. Maxfield myles.maxfi...@gmail.com wrote: Hello, I am interested in the argument to Done, namely, leftover data. More

Re: [Haskell-cafe] [Haskell] ANNOUNCE: notcpp-0.0.1

2012-04-15 Thread Ben Millwood
On Sun, Apr 15, 2012 at 7:14 PM, Steffen Schuldenzucker sschuldenzuc...@uni-bonn.de wrote: On 04/13/2012 10:49 PM, Ben Millwood wrote: I'm pleased to announce my first genuinely original Hackage package: notcpp-0.0.1! http://hackage.haskell.org/package/notcpp [...] Why is it

Re: [Haskell-cafe] strange GHCi type inference behavior involving map and partially applied functions

2012-04-15 Thread Ting Lei
Eric: Thanks a lot for explaining the issue. That's very helpful. Kind of a newbie question, how can I automatically turn on NoMonomorphismRestriction using emacs mode for haskell? I know there is the :set command, but I don't want to do it every time I start up emacs. In my humble

Re: [Haskell-cafe] process-conduit appears to hang on windows

2012-04-15 Thread grant
Hi, I am trying to use process-conduit on windows, but it appears to hang when using the conduitCmd. Is there a reason why this doesn't work? Thanks for any help, Grant I have made an attempt to create a version of process conduits that appears to work on Windows and Linux.

Re: [Haskell-cafe] Conduit Best Practices for leftover data

2012-04-15 Thread Myles C. Maxfield
2. If you use connect-and-resume ($$+), the leftovers are returned as part of the `Source`, and provided downstream. I'm trying to figure out how to use this, but I'm getting a little bit confused. In particular, here is a conduit that produces an output for every 'i' inputs. I'm returning

Re: [Haskell-cafe] Conduit Best Practices for leftover data

2012-04-15 Thread Myles C. Maxfield
Sorry for the spam. A similar matter is this following program, where something downstream reaches EOF right after a conduit outputs a HaveOutput. Because the type of the early-closed function is just 'r' or 'm r', there is no way for the conduit to return any partial output. This means that any

Re: [Haskell-cafe] strange GHCi type inference behavior involving map and partially applied functions

2012-04-15 Thread Christopher Done
On 16 April 2012 01:44, Ting Lei tin...@hotmail.com wrote: Kind of a newbie question, how can I automatically turn on NoMonomorphismRestriction using emacs mode for haskell? I know there is the :set command, but I don't want to do it every time I start up emacs. You can just add it to your

Re: [Haskell-cafe] strange GHCi type inference behavior involving map and partially applied functions

2012-04-15 Thread Brandon Allbery
On Sun, Apr 15, 2012 at 19:44, Ting Lei tin...@hotmail.com wrote: In my humble opinion, I think the GHC should turn on ExtendedDefaulting if GHCi has it on by default. Otherwise it is confusing for newbies. I think we're kinda tending in the opposite direction: we'd like

[Haskell-cafe] Building cabal-install for new ghc build

2012-04-15 Thread Lyndon Maydwell
Hi Café. I'm building GHC from package ghc-7.4.1-src.tar.bz2 as the binary download was throwing segfaults for me (and apparently a few others). This has worked well and my issues with GHC and GHCi are now resolved. However I have needed to build cabal-install. This can't be done using

Re: [Haskell-cafe] Conduit Best Practices for leftover data

2012-04-15 Thread Michael Snoyman
On Mon, Apr 16, 2012 at 12:12 AM, Myles C. Maxfield myles.maxfi...@gmail.com wrote: Thanks for responding to this. Some responses are inline. On Sat, Apr 14, 2012 at 8:30 PM, Michael Snoyman mich...@snoyman.com wrote: [snip] No, nothing so complicated is intended. Most likely you'll never

Re: [Haskell-cafe] Conduit Best Practices for leftover data

2012-04-15 Thread Michael Snoyman
I'm not really certain of your previous example, but what you're describing here is data loss. AFAIK, this is inherent to any kind of streaming approach. Have a look at the chapter in the Yesod book on conduit, the description of data loss is still accurate. On Mon, Apr 16, 2012 at 3:46 AM, Myles

Re: [Haskell-cafe] process-conduit appears to hang on windows

2012-04-15 Thread Michael Snoyman
On Mon, Apr 16, 2012 at 2:50 AM, grant the...@hotmail.com wrote: Hi, I am trying to use process-conduit on windows, but it appears to hang when using the conduitCmd. Is there a reason why this doesn't work? Thanks for any help, Grant I have made an attempt to create a version of process