Re: [Haskell-cafe] Escaping of string literals

2011-05-28 Thread Michael Snoyman
On Sun, May 29, 2011 at 4:06 AM, Yitzchak Gale wrote: > Michael Snoyman wrote: >>    main = do >>        fromAddr <- unsafePackAddressLen 7 $(return $ LitE $ >> StringPrimL "123\0\&456") >>        print fromAddr >>        let fromStr = S.pack $ map (toEnum . fromEnum) $(return $ LitE >> $ StringL

Re: [Haskell-cafe] Escaping of string literals

2011-05-28 Thread Yitzchak Gale
Michael Snoyman wrote: >    main = do >        fromAddr <- unsafePackAddressLen 7 $(return $ LitE $ > StringPrimL "123\0\&456") >        print fromAddr >        let fromStr = S.pack $ map (toEnum . fromEnum) $(return $ LitE > $ StringL "123\0\&456") >        print fromStr > > I get the result: > >

Re: [Haskell-cafe] Please help with double recursion

2011-05-28 Thread wren ng thornton
On 5/28/11 8:31 AM, Daniel Fischer wrote: On Saturday 28 May 2011 14:19:18, Dmitri O.Kondratiev wrote: Thanks for simple and beautiful code to get all pairs. Yet, I need to get to the next step - from all pairs to build all chains, to get as a result a list of lists: [[abcde, acde, ade, ae,] [

[Haskell-cafe] Haskell School of Expression (graphics)

2011-05-28 Thread michael rice
I installed the Haskell Platform (7.0.2) earlier, and I just downloaded package soegtk with cabal, apparently unsuccessfully. Any suggestions? Michael [michael@sabal ~]$ cabal updateConfig file path source is default config file.Config file /home/michael/.cabal/config not found.Writing default

Re: [Haskell-cafe] Erlang's module discussion

2011-05-28 Thread Brandon Allbery
On Sat, May 28, 2011 at 13:34, Ketil Malde wrote: > Tom Murphy writes: >>      Before you dismiss it as crazy, know that the topic was brought >> up by Joe Armstrong > > Being brilliant doesn't mean the absence of mental bad hair days, but > merely that they happen more rarely than for the rest o

Re: [Haskell-cafe] Erlang's module discussion

2011-05-28 Thread Ketil Malde
Tom Murphy writes: Modules tend to group togheter data structures and functions that operate on them - i.e. natural units of code. So I think modules are good also for didactical reasons, in that module imports limit the scope a reader needs to know to understand the code. I don't know Erlang,

Re: [Haskell-cafe] Erlang's module discussion

2011-05-28 Thread Alex Rozenshteyn
Since no-one has yet mentioned it, and I think it might be relevant, http://types.bu.edu/seminar-modularity/first-class-modules-for-haskell.pdf I haven't read it with any degree of understanding, but I don't think it's tractable to remove modules from haskell, nor desirable. On Sat, May 28, 2011

Re: [Haskell-cafe] No fish, please

2011-05-28 Thread Andrew Coppin
On 18/05/2011 10:39 PM, Andrew Coppin wrote: On 18/05/2011 05:28 AM, Don Stewart wrote: I'm intrigued by the idea of Hackage docs that don't use Haddock. This is basically the reason I asked. Currently Cabal assumes that Haddock is the only tool of its kind. If somebody built a better Haddock,

Re: [Haskell-cafe] Please help with double recursion

2011-05-28 Thread Daniel Fischer
On Saturday 28 May 2011 14:19:18, Dmitri O.Kondratiev wrote: > > Thanks for simple and beautiful code to get all pairs. > Yet, I need to get to the next step - from all pairs to build all > chains, to get as a result a list of lists: > > [[abcde, acde, ade, ae,] > [bcde, bde, be,] > [cde, cd, ce,

Re: [Haskell-cafe] Please help with double recursion

2011-05-28 Thread Dmitri O.Kondratiev
On Sat, May 28, 2011 at 3:57 PM, Daniel Fischer < daniel.is.fisc...@googlemail.com> wrote: > On Saturday 28 May 2011 13:47:10, Dmitri O.Kondratiev wrote: > > Hello, > > I am trying to solve a simple task, but got stuck with double recursion > > - for some reason not all list elements get processe

Re: [Haskell-cafe] Please help with double recursion

2011-05-28 Thread Daniel Fischer
On Saturday 28 May 2011 13:47:10, Dmitri O.Kondratiev wrote: > Hello, > I am trying to solve a simple task, but got stuck with double recursion > - for some reason not all list elements get processed. > Please advice on a simple solution, using plane old recursion :) > *** Task: > From a sequence

[Haskell-cafe] Fwd: Please help with double recursion

2011-05-28 Thread Dmitri O.Kondratiev
For some reason, my previous message got truncated, so I repeat it in hope that it will come complete this time: -- Forwarded message -- From: Dmitri O.Kondratiev Date: Sat, May 28, 2011 at 3:47 PM Subject: Please help with double recursion To: haskell-cafe@haskell.org Hello, I

[Haskell-cafe] Please help with double recursion

2011-05-28 Thread Dmitri O.Kondratiev
Hello, I am trying to solve a simple task, but got stuck with double recursion - for some reason not all list elements get processed. Please advice on a simple solution, using plane old recursion :) *** Task: >From a sequence of chars build all possible chains where each chain consists of chars th

Re: [Haskell-cafe] Erlang's module discussion

2011-05-28 Thread Brandon Allbery
On Sat, May 28, 2011 at 05:12, Alex Kropivny wrote: > Regardless of how crazy it sounds, an idea from Joe Armstrong is worth > seriously thinking over. Possibly, but this is just another manifestation of a general problem that nobody has yet managed to solve very nicely. Admittedly, the way Erla

Re: [Haskell-cafe] Erlang's module discussion

2011-05-28 Thread Serguey Zefirov
2011/5/28 Alex Kropivny : > Erlang has the advantage of functions being the basic, composeable building > block. Packages and modules are merely means to organize them, and mediocre > means at that, so a better system is definitely a possibility. Haskell has > the complication of having type defini

[Haskell-cafe] Sub class and model expansion

2011-05-28 Thread Patrick Browne
Hi, I'm not sure if this is possible but I am trying to use Haskell’s type class to specify *model expansion*. Model expansion allows the specification of new symbols (known as enrichment) or the specification further properties that should hold on old symbols. I am trying to enrich simplified Mon

Re: [Haskell-cafe] How unique is Unique

2011-05-28 Thread Heinrich Apfelmus
Emil Axelsson wrote: Hello! Lacking a proper blog, I've written some notes about Data.Unique here: http://community.haskell.org/~emax/darcs/MoreUnique/ This describes a real problem that makes Data.Unique unsuitable for implementing observable sharing. The document also proposes a solutio

Re: [Haskell-cafe] Erlang's module discussion

2011-05-28 Thread Alex Kropivny
Regardless of how crazy it sounds, an idea from Joe Armstrong is worth seriously thinking over. This has bugged me before: think about how we design and write code as project size, or programmer skill grows. You start with composing statements inside a single function; later, you start to compose

Re: [Haskell-cafe] Erlang's module discussion

2011-05-28 Thread Dmitry Vyal
On 28.05.2011 07:10, Tom Murphy wrote: Hi All, I sure love Hackage, but there's a very interesting discussion going on, on the Erlang mailing list, about completely restructuring the module-model. Before you dismiss it as crazy, know that the topic was brought up by Joe Armstrong, one