Re: [Haskell-cafe] Rank-2 types in classes

2011-03-03 Thread oleg
Yves Pare`s wrote: I'm working on a library which aims to be a generic interface for 2D rendering. To do that, one of my goals is to enable each implementation of this interface to run in its own monad (most of the time an overlay to IO), thus giving me the following class class (Monad (IM

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread Andrew Butterfield
On 3 Mar 2011, at 07:05, Hauschild, Klaus (EXT) wrote: Hi Haskellers, whats your Haskell IDE of choise? Currently I use leksah. Is the EclipseFP Plugin for Eclipse a real alternative? WinEdt*/MikTex/GHCi do leksah/EclipseFP support literate haskell programming (mix of .tex and .lhs

Re: [Haskell-cafe] operations on lists with continuations

2011-03-03 Thread Mark Lentczner
To make up for my total misunderstanding of what you were asking before, I hereby offer you the Plumbing module, available here: https://bitbucket.org/mtnviewmark/haskell-playground/src/2d022b576c4e/Plumbing.hs With it, I think you can construct the kinds of pipelines you describe with the

[Haskell-cafe] Project structure

2011-03-03 Thread Hauschild, Klaus (EXT)
Hi Haskellers, is there a recommended structure for Haskell projects. I like the Maven way (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) for Java projects. How to separate productive from test code, how to separate source code from other

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread JP Moresmau
On Thu, Mar 3, 2011 at 9:12 AM, Andrew Butterfield andrew.butterfi...@cs.tcd.ie wrote: On 3 Mar 2011, at 07:05, Hauschild, Klaus (EXT) wrote: Hi Haskellers, whats your Haskell IDE of choise? Currently I use leksah. Is the EclipseFP Plugin for Eclipse a real alternative?

Re: [Haskell-cafe] A practical Haskell puzzle

2011-03-03 Thread Eric Mertens
There were a number of emails discussing what a type-safe list solution would like look. This was the approach that first came to mind when I read your email (but I've had my head in Agda lately) http://hpaste.org/44469/software_stack_puzzle I've written up a minimal working example of this

Re: [Haskell-cafe] Rank-2 types in classes

2011-03-03 Thread Yves Parès
Thanks for your proposal. It is not clear if the class constraint is really needed. Well 'IM' means 'ImplementationMonad', so it wouldn't make much sense if an IM of an implementation wasn't also a monad. And since IM is the central monad of the library, a lot of functions will use IM. The

[Haskell-cafe] Haskell KMP(Knuth-Morris-Pratt) algorithm

2011-03-03 Thread larry.liuxinyu
Hi, I read about some KMP implementation in Haskell including: [1] Richard Bird. ``Pearls of Functional algorithm design'' [2] http://twan.home.fmf.nl/blog/haskell/Knuth-Morris-Pratt-in-Haskell.details [3] http://www.haskell.org/haskellwiki/Runtime_compilation [4] LazyString version [1]

Re: [Haskell-cafe] A practical Haskell puzzle

2011-03-03 Thread Yitzchak Gale
Brandon Moore wrote: This code produces and uses a table of all allowed combinations. I think this makes it easier to understand why the code works (and is H98). It's just as easy to make a direct version that produces one requested composition in linear time, so I haven't worried whether

Re: [Haskell-cafe] A practical Haskell puzzle

2011-03-03 Thread Yitzchak Gale
Eric Mertens wrote: (but I've had my head in Agda lately) Indeed, coming across this problem tempted me to abandon the real world and take refuge in Agda. http://hpaste.org/44469/software_stack_puzzle Wow, so simple, and no higher-rank types! This is the best solution yet. I am now truly in

Re: [Haskell-cafe] Haskell KMP(Knuth-Morris-Pratt) algorithm

2011-03-03 Thread larry.liuxinyu
Hi, Here is Richard Bird's version for reference. I changed it a bit. data State a = E | S a (State a) (State a) matched (S (_, []) _ _) = True matched _ = False kmpSearch4 :: (Eq a) = [a] - [a] - [Int] kmpSearch4 ws txt = snd $ foldl tr (root, []) (zip txt [1..]) where root = build E ([],

Re: [Haskell-cafe] Project structure

2011-03-03 Thread John Lato
From: Hauschild, Klaus (EXT) Hi Haskellers, is there a recommended structure for Haskell projects. I like the Maven way ( http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) for Java projects. How to separate productive from test code, how to

Re: [Haskell-cafe] Terminal library : which ?

2011-03-03 Thread Alexander Danilov
25.02.2011 03:36, Permjacov Evgeniy пишет: What terminal library you will recomedn? Requirements: crossplatform (win/lin), with direct (i.e. with line/column number pair) cursor positioning and possybly direct symbol output. MUST provide function to get terminal dimensions. (could not find one).

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread Mihai Maruseac
On Thu, Mar 3, 2011 at 9:05 AM, Hauschild, Klaus (EXT) klaus.hauschild@siemens.com wrote: Hi Haskellers, whats your Haskell IDE of choise? Currently I use leksah. Is the EclipseFP Plugin for Eclipse a real alternative? Thanks Hi, I use vim in terminator: one window with the source,

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread Alexander Danilov
03.03.2011 16:05, Hauschild, Klaus (EXT) пишет: Hi Haskellers, whats your Haskell IDE of choise? Currently I use leksah. Is the EclipseFP Plugin for Eclipse a real alternative? Thanks Klaus Emacs, look at haskell wiki for details about haskell-mode.

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread Paul Sujkov
Hi, I use emacs. Tried leksah a couple of times, but wasn't satisfied by it's stability and user friendliness. On 3 March 2011 09:05, Hauschild, Klaus (EXT) klaus.hauschild@siemens.com wrote: Hi Haskellers, whats your Haskell IDE of choise? Currently I use leksah. Is the EclipseFP

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread Paul Sujkov
Hi, you can always check the types using GHCi prompt: *Prelude :i (,) data (,) a b = (,) a b -- Defined in GHC.Tuple instance (Bounded a, Bounded b) = Bounded (a, b) -- Defined in GHC.Enum instance (Eq a, Eq b) = Eq (a, b) -- Defined in Data.Tuple instance Functor ((,) a) -- Defined in

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread Karthick Gururaj
On Thu, Mar 3, 2011 at 8:00 PM, Paul Sujkov psuj...@gmail.com wrote: Hi, you can always check the types using GHCi prompt: *Prelude :i (,) data (,) a b = (,) a b -- Defined in GHC.Tuple instance (Bounded a, Bounded b) = Bounded (a, b)   -- Defined in GHC.Enum instance (Eq a, Eq b) = Eq (a,

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread Michal Konečný
On Thu, Mar 3, 2011 at 9:05 AM, Hauschild, Klaus (EXT) klaus.hauschild@siemens.com wrote: whats your Haskell IDE of choise? Currently I use leksah. Is the EclipseFP Plugin for Eclipse a real alternative? I use EclipseFP 2.0.2 on a few fairly large projects and am overall very happy with it

[Haskell-cafe] ANN: hmpfr-0.3.2 (requires integer-simple, supports mpfr 3.0.0)

2011-03-03 Thread Michal Konečný
Dear all, I am pleased to announce hmpfr-0.3.2, a new version of Aleš Bizjak's bindings to the MPFR arbitrary precision floating point arithmetic library. The changes in this version are quite small but significant: - support for MPFR 3.0.0 as well as MPFR 2.4.* - dependency on integer-simple

Re: [Haskell-cafe] A practical Haskell puzzle

2011-03-03 Thread Brandon Moore
From: Yitzchak Gale g...@sefer.org Brandon Moore wrote: This code produces and uses a table of all allowed combinations. I think this makes it easier to understand why the code works (and is H98). It's just as easy to make a direct version that produces one requested composition in

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread Andrew Coppin
On 03/03/2011 07:12 AM, Eugene Kirpichov wrote: However, now I actually use vim - but that's because I'm scared of trying to install Leksah on Windows (maybe it isn't hard, I haven't tried) and because I'm only doing rather tiny things with Haskell at the moment. FWIW, last time I tried,

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread Simon Heath
Emacs. haskell-mode is also rather slicker than most emacs major modes I've seen; it recognizes syntax as you type, does the right thing with indentation levels, and so on. -- Simon Heath                       icefo...@gmail.com Follow your heart, and keep on rocking.  http://alopex.li/

Re: [Haskell-cafe] A practical Haskell puzzle

2011-03-03 Thread Yitzchak Gale
Brandon Moore wrote: My solution does not serialize and deserialize between every pair of layers. Ahhh, I see! Sorry I didn't look closely enough the first time. Yes, this is a very nice Haskell 98 solution! This code produces and uses a table of all allowed combinations. I think this makes

Re: [Haskell-cafe] A simple attoparsec question

2011-03-03 Thread Malcolm Wallace
On 1 Mar 2011, at 21:58, Evan Laforge wrote: parseConstant = Reference $ try parseLocLabel | PlainNum $ decimal | char '#' * fmap PlainNum hexadecimal | char '\'' * (CharLit $ notChar '\n') * char '\'' | try $ (char '' * (StringLit . B.pack

Re: [Haskell-cafe] ANN: theoremquest-0.0.0

2011-03-03 Thread Henning Thielemann
Daniel Peebles schrieb: Have you tried it? It's completely addictive (and takes up a big chunk of my free time). +1 after completing some missions in PVS. :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] ANN: Version 0.14 of dataenc, version 0.5 of omnicodec

2011-03-03 Thread Magnus Therning
I've just uploaded a new version of dataenc to hackage[1]. It contains a large change to the API. The old, rather simplistic, lazy API has been removed. It has been replaced by an API based on incremental encoding/decoding. This should make the library easier to use together with left-fold

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread Alexander Solla
On Wed, Mar 2, 2011 at 10:09 PM, Karthick Gururaj karthick.guru...@gmail.com wrote: Hello, I'm learning Haskell from the extremely well written (and well illustrated as well!) tutorial - http://learnyouahaskell.com/chapters. I have couple of questions from my readings so far. In

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread Michael Xavier
I use vim (CLI not gvim). Any productivity I lose without the niceties of Leksah are probably made up for with the gains from being a vim user for years. -- Michael Xavier http://www.michaelxavier.net ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread Richard O'Keefe
By the way, tuples *can* be members of Enum if you make them so. Try instance (Enum a, Enum b, Bounded b) = Enum (a,b) where toEnum n = (a, b) where a = toEnum (n `div` s) b = toEnum (n `mod` s) p = fromEnum (minBound `asTypeOf` b)

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread Alexander Solla
On Thu, Mar 3, 2011 at 1:58 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote: I can't think of an approach that doesn't require all but one of the tuple elements to have Bounded types. It's not possible. Such an enumeration could potentially have an uncomputable order-type, possibly equal to

Re: [Haskell-cafe] ANN: hmpfr-0.3.2 (requires integer-simple, supports mpfr 3.0.0)

2011-03-03 Thread Edward Kmett
Woohoo! I tried to fix up the hmpfr bindings myself before the integer-simple/integer-gmp split was done, but it was impossible given the way GHC hooks into the gmp allocator. The main issue appears to be the fact that as mpfr has matured it has come to do more internal allocation to handle

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread Daniel Fischer
On Thursday 03 March 2011 23:25:48, Alexander Solla wrote: On Thu, Mar 3, 2011 at 1:58 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote: I can't think of an approach that doesn't require all but one of the tuple elements to have Bounded types. It's not possible. Meaning: It's not possible

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread Daniel Fischer
On Thursday 03 March 2011 22:14:34, Michael Xavier wrote: I use vim (CLI not gvim). I use kate. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] ANN: cabal-dev-0.7.4.0

2011-03-03 Thread Rogan Creswick
We're happy to announce that cabal-dev-0.7.4.0 is now on hackage. We strongly suggest that everyone upgrade to this release, since this release specifically addresses changes in Cabal-1.10 and newer, which the latest cabal-install now uses. The ticket for the bug is here, for anyone interested:

[Haskell-cafe] groupBy huh?

2011-03-03 Thread Jacek Generowicz
Hi Cafe, It seems that I don't understand what groupBy does. I expect it to group together elements as long as adjacent ones satisfy the predicate, so I would expect ALL four of the following to give one group of 3 and a group of 1. Prelude :m + Data.List Prelude Data.List groupBy () abcb

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread Markus Läll
I have been using Notepad++ -- it has proper (I think) syntaks highlighting and in the latest version now has line wrapping a la kate: broken lines start at the indent level of the first one. -- Markus Läll On Fri, Mar 4, 2011 at 1:14 AM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote:

Re: [Haskell-cafe] groupBy huh?

2011-03-03 Thread Marc Weber
Excerpts from Jacek Generowicz's message of Fri Mar 04 00:18:07 + 2011: Prelude Data.List groupBy () [1,2,3,2] [[1,2,3,2]] This is wired. However if you think about the algorithm always using the first element of a list and comparing it against the next elements you get 1 2 ok, same group

Re: [Haskell-cafe] groupBy huh?

2011-03-03 Thread Daniel Fischer
On Friday 04 March 2011 01:18:07, Jacek Generowicz wrote: Hi Cafe, It seems that I don't understand what groupBy does. I expect it to group together elements as long as adjacent ones satisfy the predicate, so I would expect ALL four of the following to give one group of 3 and a group of

Re: [Haskell-cafe] groupBy huh?

2011-03-03 Thread Jacek Generowicz
On 2011 Mar 4, at 01:39, Marc Weber wrote: Excerpts from Jacek Generowicz's message of Fri Mar 04 00:18:07 + 2011: Prelude Data.List groupBy () [1,2,3,2] [[1,2,3,2]] This is wired. However if you think about the algorithm always using the first element of a list and comparing it

Re: [Haskell-cafe] groupBy huh?

2011-03-03 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/3/11 20:09 , Jacek Generowicz wrote: 1 2 ok, same group 1 3 dito 1 2 dito Thus you get [[1,2,3,2]] OK, that works, but it seems like a strange choice ... Stability is often valued in functions like this: the order of elements is not

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread Markus
What about having the order by diagonals, like: 0 1 3 2 4 5 and have none of the pair be bounded? -- Markus Läll On 4 Mar 2011, at 01:10, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: On Thursday 03 March 2011 23:25:48, Alexander Solla wrote: On Thu, Mar 3, 2011 at 1:58 PM,

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread Daniel Fischer
On Friday 04 March 2011 03:24:34, Markus wrote: What about having the order by diagonals, like: 0 1 3 2 4 5 and have none of the pair be bounded? I tacitly assumed product order (lexicographic order). ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] groupBy huh?

2011-03-03 Thread Joachim Breitner
Hi, Am Freitag, den 04.03.2011, 01:18 +0100 schrieb Jacek Generowicz: It seems that I don't understand what groupBy does. I expect it to group together elements as long as adjacent ones satisfy the predicate, so I would expect ALL four of the following to give one group of 3 and a group

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread Karthick Gururaj
There are so many responses, that I do not know where to start.. I'm top-posting since that seems best here, let me know if there are group guidelines against that. Some clarifications in order on my original post: a. I ASSUMED that '()' refers to tuples, where we have atleast a pair. This is

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread Richard O'Keefe
On 4/03/2011, at 5:49 PM, Karthick Gururaj wrote: I meant: there is no reasonable way of ordering tuples, let alone enum them. There are several reasonable ways to order tuples. That does not mean we can't define them: 1. (a,b) (c,d) if ac Not really reasonable because it isn't

Re: [Haskell-cafe] Project structure

2011-03-03 Thread wren ng thornton
On 3/3/11 3:33 AM, Hauschild, Klaus (EXT) wrote: Hi Haskellers, is there a recommended structure for Haskell projects. I like the Maven way (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html) for Java projects. How to separate productive from test

Re: [Haskell-cafe] groupBy huh?

2011-03-03 Thread wren ng thornton
On 3/3/11 7:18 PM, Jacek Generowicz wrote: Hi Cafe, It seems that I don't understand what groupBy does. I expect it to group together elements as long as adjacent ones satisfy the predicate, so I would expect ALL four of the following to give one group of 3 and a group of 1. Prelude :m +

Re: [Haskell-cafe] groupBy huh?

2011-03-03 Thread wren ng thornton
On 3/3/11 8:14 PM, Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/3/11 20:09 , Jacek Generowicz wrote: 1 2 ok, same group 1 3 dito 1 2 dito Thus you get [[1,2,3,2]] OK, that works, but it seems like a strange choice ... Stability is often valued in

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-03 Thread wren ng thornton
On 3/3/11 2:58 AM, Antti-Juhani Kaijanaho wrote: On Thu, Mar 03, 2011 at 12:29:44PM +0530, Karthick Gururaj wrote: Thanks - is this the same unit that accompanies IO in IO () ? In any case, my question is answered since it is not a tuple. It can be viewed as the trivial 0-tuple. Except that

[Haskell-cafe] Thoughts on program annotations.

2011-03-03 Thread Jason Dusek
Hi List, I am working on a Bash config generation system. I've decided to factor out the Bash AST and pretty printer, here in a pre-release state: https://github.com/solidsnack/bash One thing I'd like to support is generic annotations, so that at a future time I can add (and

Re: [Haskell-cafe] groupBy huh?

2011-03-03 Thread Jacek Generowicz
On 2011 Mar 4, at 02:14, Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/3/11 20:09 , Jacek Generowicz wrote: 1 2 ok, same group 1 3 dito 1 2 dito Thus you get [[1,2,3,2]] OK, that works, but it seems like a strange choice ... Stability is often

Re: [Haskell-cafe] Thoughts on program annotations.

2011-03-03 Thread wren ng thornton
On 3/4/11 1:32 AM, Jason Dusek wrote: Hi List, I am working on a Bash config generation system. I've decided to factor out the Bash AST and pretty printer, here in a pre-release state: https://github.com/solidsnack/bash Awesome! Given that every statement has an

Re: [Haskell-cafe] Thoughts on program annotations.

2011-03-03 Thread Max Bolingbroke
On 4 March 2011 06:32, Jason Dusek jason.du...@gmail.com wrote:    --  From https://github.com/solidsnack/bash/blob/c718de36d349efc9ac073a2c7082742c45606769/hs/Language/Bash/Syntax.hs    data Annotated t = Annotated t (Statement t)    data Statement t = SimpleCommand Expression [Expression]