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

2011-03-03 Thread Max Bolingbroke
On 4 March 2011 06:32, Jason Dusek 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] >                

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 annotati

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 val

[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 rend

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 t

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 f

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 + Data

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 c

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 a>c Not really reasonable because it isn't com

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 fro

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 g

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 Has

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 > wrote: On Thursday 03 March 2011 23:25:48, Alexander Solla wrote: On Thu, Mar 3, 2011 at 1:58 PM, Richard O'Keefe wrote: I can't t

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 eleme

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 again

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 grou

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 gr

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:

[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 (<) "a

[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: h

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

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 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 while respect

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 corner

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 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 the order-type of

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] 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 Haskell-Cafe@haskell.or

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 "

[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 enum

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 http://www.haskell.org/mailman/li

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 '"' *> (S

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 thi

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] 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, "inst

Re: [Haskell-cafe] A practical Haskell puzzle

2011-03-03 Thread Brandon Moore
> From: 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 li

[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] Haskell IDE

2011-03-03 Thread Michal Konečný
On Thu, Mar 3, 2011 at 9:05 AM, Hauschild, Klaus (EXT) 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 despite a few flaws, eg: - i

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 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, b) -- De

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 Contr

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] 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 Mihai Maruseac
On Thu, Mar 3, 2011 at 9:05 AM, 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? > > Thanks > Hi, I use vim in terminator: one window with the source, one with ghci and one small

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] 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,

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] 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] 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 wheth

[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] buil

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 meth

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 appro

Re: [Haskell-cafe] Haskell IDE

2011-03-03 Thread JP Moresmau
On Thu, Mar 3, 2011 at 9:12 AM, Andrew Butterfield 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? > > WinEdt*/MikTex/GHCi > do leksah/Eclips

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 compo

[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 resour

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] 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 (Mona