[Haskell-cafe] GHC bug? Let with guards loops

2013-07-09 Thread Andreas Abel
and single-branch case are interchangeable, but apparently, not... Cheers, Andreas -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andreas.a...@ifi.lmu.de http:/

Re: [Haskell-cafe] GHC bug? Let with guards loops

2013-07-09 Thread Andreas Abel
loops = let Just x = case () of () | x > 0 -> Just 1 in x Here it's obvious that 'x' is used in the rhs of its own definition. Roman * Andreas Abel [2013-07-09 16:42:00+0200] Hi, is this a known bug or feature of GHC (7.4.1, 7.6.3)?: I got a loopi

Re: [Haskell-cafe] GHC bug? Let with guards loops

2013-07-09 Thread Andreas Abel
e guard. But, since you could use something from the where clause on the guard, and we certainly won't be restricting recursing on the where clause, it also seems compelling to allow recursion on the guard. My 2 centavos, =) On Tue, Jul 9, 2013 at 2:12 PM, Andreas Abel wrote: Thank

Re: [Haskell-cafe] GHC bug? Let with guards loops

2013-07-09 Thread Andreas Abel
ave the same way now. Which ones should change? Only the first one? Hard to tell. If Haskell had a non-recursive let, that'd probably be a different story. But it doesn't. Definitely agree. On Tue, Jul 9, 2013 at 1:12 PM, Andreas Abel mailto:andreas.a...@ifi.lmu.de>> wrote:

Re: [Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guards loops]

2013-07-10 Thread Andreas Abel
u might want to write it now. In the meanwhile, there is a very ugly workaround: test = runIdentity $ do (x,s) <- return $ foo 1 [] (y,s) <- return $ bar x s (z,s) <- return $ baz x y s return (z,s) After all, bind is non-recursive let. -- Andreas

Re: [Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guards loops]

2013-07-10 Thread Andreas Abel
giggle): http://hackage.haskell.org/packages/archive/mtl/2.1/doc/html/src/Control-Monad-State-Class.html#state -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andreas.a...@ifi.lmu.de http://w

Re: [Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guardsloops]

2013-07-10 Thread Andreas Abel
e some optional totality checking in Haskell. If Oleg decides not to use a state monad, he will still have to be careful not to confuse the numbers, but if he does, then the compiler will reject his code instead of producing <>ing code. Greets, Ertugrul -- Andreas Abel <>< Du

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-10 Thread Andreas Abel
and (not to be or to be and (not to be or to be and ... that is the list monad. -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andreas.a...@ifi.lmu.de http://www2.tcs.ifi.lmu.de/~abe

Re: [Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guardsloops]

2013-07-10 Thread Andreas Abel
ld doubt that nhc98 would interpret let xs = 0 : xs differently than ghc if it implemented anything close to the Haskell 98 standard. But I am not in a position to prove you wrong. Cheers, Andreas -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science,

Re: [Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guards loops]

2013-07-10 Thread Andreas Abel
of your identifiers... -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andreas.a...@ifi.lmu.de http://www2.tcs.ifi.lmu.de/~abel/ ___ Haskell-Cafe mailing

Re: [Haskell-cafe] Non-recursive let

2013-07-11 Thread Andreas Abel
In my own code, this idiom is more likely than the one that sparked the discussion. Doug ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Andreas Abel <>< Du bist der gel

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-11 Thread Andreas Abel
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMA

Re: [Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guards loops]

2013-07-11 Thread Andreas Abel
ler than that. So I do not see your point. -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andreas.a...@ifi.lmu.de http://www2.tcs.ifi.lmu.de/~abel/

Re: [Haskell-cafe] ordNub

2013-07-16 Thread Andreas Abel
terM. In fact, your implementation is already in the (Set a ->) reader monad, in normalized form. It looks already optimal to me. Cheers, Andreas -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Mu

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-16 Thread Andreas Abel
baz x y s of (z, s) -> ... -Edward -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andreas.a...@ifi.lmu.de http://www2.tcs.ifi.lmu.de/~abel/ __

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-17 Thread Andreas Abel
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-18 Thread Andreas Abel
the time and that was only because it was in the only package I was not using -Wall on. -Edward On Wed, Jul 17, 2013 at 12:23 PM, Andreas Abel mailto:andreas.a...@ifi.lmu.de>> wrote: Here, again, is your ACTUAL CODE, commented, deployed, looping, and maybe linked into your projec

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-22 Thread Andreas Abel
s an example OF, however. I found the code a little difficult to follow, but when that's fixed up, there's no longer any reason to want non-recursive let, OR a monad. I've run out of time tonight, but hope to say more tomorrow. ___ Haskell-Cafe mailing li

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-22 Thread Andreas Abel
o do scope-checking before type-checking, which also makes sense, you cannot make recursiveness type-dependent. Distinguishing 'let' into 'fun', 'val' and 'val rec' could help here: Non-recursive: val x = e in e' Recursive: fun f x = e

Re: [Haskell-cafe] memoization

2013-07-22 Thread Andreas Abel
ons do not matter. Cheers, Andreas -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andreas.a...@ifi.lmu.de http://www2.tcs.ifi.lmu.de/~abel/ ___ Haskel

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-22 Thread Andreas Abel
On 22.07.2013 10:50, MigMit wrote: On Jul 22, 2013, at 12:27 PM, Andreas Abel wrote: On 20.07.13 9:36 PM, Evan Laforge wrote: However, I'm also not agitating for a non-recursive let, I think that ship has sailed. Besides, if it were added people would start wondering about non-recu

Re: [Haskell-cafe] memoization

2013-07-24 Thread Andreas Abel
ently lifts them out. Thus, for -O1.. memoized_fib is also memoizing. (I ran it, this time ;-) !) Cheers, Andreas On 22.07.13 11:43 PM, Tom Ellis wrote: On Mon, Jul 22, 2013 at 04:16:19PM +0200, Andreas Abel wrote: In general, I would not trust such compiler magic, but just let-bind anything

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-24 Thread Andreas Abel
On 23.07.13 4:34 AM, Richard A. O'Keefe wrote: On 22/07/2013, at 8:14 PM, Andreas Abel wrote: Just today, my student asked me why the following program does nothing: Did you ask your student why their code should not be torn into pieces, burned to ashes, and incorporated into a po

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-24 Thread Andreas Abel
sufficiently lazy, e.g. in the one point compactification of the naturals: data Conat = S Conat | Z There it represents infinity with proper sharing. -Edward On Jul 22, 2013, at 10:24 AM, Andreas Abel wrote: On 22.07.2013 10:50, MigMit wrote: On Jul 22, 2013, at 12:27 PM, Andreas Abel

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-26 Thread Andreas Abel
re ps = (:) <$> p <*> ps <|> pure [] is another perfectly cromulent example of "value" recursion, and one that is far nearer and dearer to my heart and is similarly opaque to any such analysis. -Edward On Wed, Jul 24, 2013 at 4:14 AM, Andreas Abel mailto:andreas

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-26 Thread Andreas Abel
th (\_ x -> x) headers $ ast let title = M.member "Title" ast let headers1 = if title then headers else M.delete "_limit_to " . M.delete "_limit_recd" $ headers write_fields h ast1 fields return (rv,headers1,mv) ___ Hask

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-08-02 Thread Andreas Abel
On 26.07.13 6:44 PM, Andreas Abel wrote: headers0 <- M.fromList <$> do forM fields_header $ \ (n, fld) -> do (n,) <$> reflect $ fld ast Ah, I forgot one more 'do' to override the stronger binding of <$>: (n,) <$> do reflect $

Re: [Haskell-cafe] Some philosophy (Was: Alternative name for return)

2013-08-13 Thread Andreas Abel
On 09.08.2013 17:44, Jerzy Karczmarczuk wrote: "Indiscrete Thoughts" by Gian-Carlo Rota, published by Birkhäuser in 1997. Available on the Web. For download or to buy? [This looks very interesting...] -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretic

Re: [Haskell-cafe] Alternative name for return

2013-08-13 Thread Andreas Abel
reading from a, thus, application f x is ambiguous or too sensitive, especially with type inference. I realise that this may be too open a research area for your project... -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Muni

Re: [Haskell-cafe] Hackage 2 now available for beta testing

2013-09-12 Thread Andreas Abel
e > want or that are in need of improvement. Help on any of these would be > greatly appreciated. > > There is some developer and user documentation on the github wiki, > including a quick guide to getting your own server instance up and > running. > > You can ask que

Re: [Haskell-cafe] Proposal: New syntax for Haskell

2013-09-12 Thread Andreas Abel
" as a task name > > I was much more sceptical when I had only seen the example in Niklas's > message. > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe [1]

[Haskell-cafe] Haskell's type inference considered harmful [Re: [Haskell] A riddle...]

2012-07-17 Thread Andreas Abel
Agda cannot generalize). The user has to go back an insert more type annotations. But this is safe, whereas silent late instantiation breaks compositionality. On 16.07.2012 17:25, Andreas Abel wrote: Today a student came to me with a piece of code that worked it executed by itself, b

Re: [Haskell-cafe] Haskell's type inference considered harmful

2012-07-20 Thread Andreas Abel
overloading. All these features are essential (type-classes are significant, defaulting is part of the standard and is being used more and more). -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr.

Re: [Haskell-cafe] Haskell's type inference considered harmful

2012-07-23 Thread Andreas Abel
What made you think that? Your questions weren't well answered? What other venue would you propose? Yes, they were. But for discussion about metavariables maybe something like a haskell implementor's forum would be more appropriate. Yet I am only an Agda implementor. Cheers, Andreas

Re: [Haskell-cafe] Over general types are too easy to make.

2012-09-04 Thread Andreas Abel
x monolithic parts, where a lot of Haskell programmers will have a tendency to work with simpler types and break things down into smaller pieces. But... who knows... I haven't seen the many cases where this has happened to you. -- Chris ___

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-10-22 Thread Andreas Abel
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Mu

[Haskell-cafe] How to avoid T3 fonts in pdf generated with lhs2TeX?

2012-11-01 Thread Andreas Abel
]{inputenc} If I remove this, my unicode characters are garbled in the lhs2tex-generated code. Does anoyone know a smart workaround besides replacing all the unicode characters manually by some math symbols in the .tex file? Cheers, Andreas -- Andreas Abel <>< Du bist der gelieb

Re: [Haskell-cafe] [Agda] How to avoid T3 fonts in pdf generated with lhs2TeX?

2012-11-02 Thread Andreas Abel
Hi, I found the problem, it solved itself with an update of the TeXLive suite... https://github.com/kosmikus/lhs2tex/issues/24 Thanks for your help! Andreas On 01.11.12 11:15 PM, Dominique Devriese wrote: Andreas, 2012/11/1 Andreas Abel : Hello, maybe someone has experience in

Re: [Haskell-cafe] more sharing in generated code

2012-11-03 Thread Andreas Abel
rictness penalty. Cheers, Andreas -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andreas.a...@ifi.lmu.de http://www2.tcs.ifi.lmu.de/~abel/ __

[Haskell-cafe] mtl-2.1 severly broken, cabal needs blacklisting

2012-11-13 Thread Andreas Abel
ever be selected by cabal install (except maybe by explicit user safety overriding). I think such a mechanism is not only necessary for security purposes, but also to safe the valuable resources of our community. Cheers, Andreas -- Andreas Abel <>< Du bist der geliebte Mens

Re: [Haskell-cafe] mtl-2.1 severly broken, cabal needs blacklisting

2012-11-13 Thread Andreas Abel
ckages that rely on the specific interface of mylib-2.1 (e.g. having a constraint mylib == 2.1) and do not work with mylib-2.2 would still work, since they would be built with mylib-2.1.1 On Tue, Nov 13, 2012 at 9:27 AM, Andreas Abel mailto:andreas.a...@ifi.lmu.de>> wrote: After 2 da

Re: [Haskell-cafe] hackageDB haddock errors

2012-11-13 Thread Andreas Abel
t docs, means that I cannot currently search for anything gtk2hs related :( Can someone please look into prodding this cron job so it doesn't take days to run, or look into resolving any errors that might be causing this unfortunate behaviour? Thank you for your time, and happy hacking, Ti

Re: [Haskell-cafe] mtl-2.1 severly broken, cabal needs blacklisting

2012-11-13 Thread Andreas Abel
are easily overlooked. In a typical cabal install session I see tons of irrelevant warnings floating by. On Nov 13, 2012 6:12 PM, "Andreas Abel" mailto:andreas.a...@ifi.lmu.de>> wrote: On 13.11.2012 17:39, Dan Burton wrote: Mixed feelings here. I personally

Re: [Haskell-cafe] Taking over ghc-core

2012-11-14 Thread Andreas Abel
kell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andreas.a...@ifi.lmu.

Re: [Haskell-cafe] Is anyone working on a sparse matrix library in Haskell?

2012-11-29 Thread Andreas Abel
Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andr

Re: [Haskell-cafe] lambda case (was Re: A big hurray for lambda-case (and all the other good stuff))

2012-11-29 Thread Andreas Abel
roduce any new syntactic elements and has fewer tokens at the point of use. I don’t see any need for a \ in the syntax: this is a functional language we are talking about after all. Once we know that “of” introduces a function, that should be enough. -- Andreas Abel <>< Du bist

Re: [Haskell-cafe] lambda case

2012-11-30 Thread Andreas Abel
import System.Environment case' :: b -> (b -> c) -> c case' = flip ($) main = do s <- getArgs case' s $ \case -- image '\case' was actually '\of' or 'of' [x] -> putStrLn ("Hello " ++ x) _

Re: [Haskell-cafe] mtl: Why there is "Monoid w" constraint in the definition of class MonadWriter?

2012-12-10 Thread Andreas Abel
not to declare it a Monoid. Likewise, imposing a (technical) superclass constraint on MonadWriter has nothing to do with whether the Monad will be well-behaved. This is true in both directions: even if the type is an instance of Monoid, nothing forces the Monad instance to use the

[Haskell-cafe] Conflicting bindings legal?!

2013-02-26 Thread Andreas Abel
;) x where scope = (currentScope defaultEnv) { scopePrecedence = ctx } I am surprised this is a legal form of shadowing. To understand which definition of 'scope' shadows the other, I have to consult the formal definition of Haskell. But I studied computer science to *not* bec

Re: [Haskell-cafe] Conflicting bindings legal?!

2013-02-26 Thread Andreas Abel
Luckily, {-# OPTIONS -fwarn-unused-binds #-} saves me from searching for the formal spec... On 26.02.13 10:25 AM, Andreas Abel wrote: To your amusement, I found the following in the Agda source: abstractToConcreteCtx :: ToConcrete a c => Precedence -> a -> TCM c abstractToConcrete

Re: [Haskell-cafe] Conflicting bindings legal?!

2013-02-27 Thread Andreas Abel
he block structure is implicit and handled by indentation). Cheers, Andreas On 26.02.2013 10:57, Tillmann Rendel wrote: Hi, Andreas Abel wrote: To your amusement, I found the following in the Agda source: abstractToConcreteCtx :: ToConcrete a c => Precedence -> a -> TCM c abstractT

Re: [Haskell-cafe] Lambda Calculus question on equivalence

2013-05-03 Thread Andreas Abel
list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr. 67, D-80538 Munich, GERMANY andreas.a...@ifi.lmu.de http://www2.tcs.ifi.lmu.de/~a

Re: [Haskell-cafe] mapFst and mapSnd

2013-05-28 Thread Andreas Abel
___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Andreas Abel <>< Du bist der geliebte Mensch. Theoretical Computer Science, University of Munich Oettingenstr.