I start some ip networks related work in haskell and wrote two basic
classes Location and Packet. Before writing IpLocation and IpPacket
instances i have written simple TestLocation and TestPacket instances
just to compile this and check for errors in class definitions. But
looks like i misunde
At 14:24 07/07/04 +0200, Henning Thielemann wrote:
On Wed, 7 Jul 2004, Graham Klyne wrote:
> [[
> sss :: [ShowS]
> sss = map (++) ["abc","def","ghi","jkl"]
>
> ssr = foldr (.) id sss
> ssl = foldl (.) id sss
>
> sr = ssr ""
> sl = ssl ""
>
> -- sl == sr == "abcdefghijkl"
> -- is there any efficienc
On Wed, 7 Jul 2004, Graham Klyne wrote:
> [[
> sss :: [ShowS]
> sss = map (++) ["abc","def","ghi","jkl"]
>
> ssr = foldr (.) id sss
> ssl = foldl (.) id sss
>
> sr = ssr ""
> sl = ssl ""
>
> -- sl == sr == "abcdefghijkl"
> -- is there any efficiency difference?
> ]]
>
> Conventional wisdom su
I have a sequence of functions that I wish to fold together using function
composition (.). Does it matter if I use foldl or foldr?
e.g.
[[
sss :: [ShowS]
sss = map (++) ["abc","def","ghi","jkl"]
ssr = foldr (.) id sss
ssl = foldl (.) id sss
sr = ssr ""
sl = ssl ""
-- sl == sr == "abcdefghijkl"
On 06 July 2004 11:29, Conor T McBride wrote:
> OK, here's what I want, what I do with it, and my attempt to deliver
> it. But I'm not an expert, so please let me know if there's some
> disastrous flaw...
>
> The signature/spec:
>
> type Hole x
>
> hole :: IO (Hole x)
>-- returns a fresh em
> now 134
> roman=(!6);n!a|n<1=""|n>=t=s!!a:(n-t)!a|c>=t=s!!(2*e):c!a|1>0=n!(a-1)where(d,m)=a`divMod`2;e=d+m-1;s="ivxlcdm";c=10^e+n;t=10^d*(1+4*m)
Gosh!
Anyway, you missed the roman symbols for 5000 (U+2181) and
1 (U+2182)... ;-) The ones for 5 and 10 aren't in
Unicode yet, nor is th
Hi folks
I had a bit more of a play over the weekend. Got addicted.
Lumps of code further on down.
Jan-Willem Maessen wrote:
>If you're really using MVars in write-once read-many style, the
>semantics of readMVar shouldn't be a problem:
>
>* Before the initializing write, all calls to readMVar bloc
At 10:23 06/07/04 -0400, Scott Turner wrote:
On 2004 July 06 Tuesday 05:35, Graham Klyne wrote:
> When I'm designing datatypes for a Haskell program, I sometimes seem to end
> up with a slightly incoherent mixture of algebraic types and
> constructors.
> example
> data Event = Document DocURI Eleme
I'm using:
GHC 6.2.1
HSQL 1.4
on a Windows XP machine.
I'm trying to the compile the HSQL example using the eclipse Haskell
plug-in, but I get the following error message:
Chasing modules from: Main.hs
Compiling Queries ( ./Queries.hs, C:\workspace\dbtest\out/Queries.o )
./Queries.hs:3