[Haskell-cafe] Re: [Haskell] Top Level <-

2008-09-02 Thread Ashley Yakeley
Ganesh Sittampalam wrote: In any case, what I'm trying to establish below is that it should be a safety property of <- that the entire module (or perhaps mutually recursive groups of them?) can be duplicated safely - with a new name, or as if with a new name - and references to it randomly rewr

Re: [Haskell-cafe] Re: ANN: zip-archive 0.1

2008-09-02 Thread Don Stewart
jgm: > Thanks again for the feedback! I've modified the zip-archive library > along the lines you suggested. Version 0.1 is now available on > HackageDB. And, of course, natively packaged for Arch, http://aur.archlinux.org/packages.php?ID=19555 Go, packagers, go! :) -- Don _

Re: [Haskell-cafe] Re: Arrow without `>>>'

2008-09-02 Thread Peter Gavin
Valery V. Vorotyntsev wrote: On 1/23/08, David Menendez <[EMAIL PROTECTED]> wrote: On Jan 23, 2008 12:20 PM, Valery V. Vorotyntsev <[EMAIL PROTECTED]> wrote: I've built GHC from darcs, and... Could anybody tell me, what's the purpose of Arrow[1] not having `>>>' method? It's derived from the C

[Haskell-cafe] Re: ANN: zip-archive 0.1

2008-09-02 Thread John MacFarlane
Thanks again for the feedback! I've modified the zip-archive library along the lines you suggested. Version 0.1 is now available on HackageDB. John +++ Duncan Coutts [Aug 26 08 21:36 ]: > > Generally it looks good, that the operations on the archive are mostly > separated from IO of writing out

Re: [Haskell-cafe] What monad am I in?

2008-09-02 Thread Philip Weaver
On Tue, Sep 2, 2008 at 5:33 PM, Ryan Ingram <[EMAIL PROTECTED]> wrote: > ghci has some crazy defaulting rules for expressions at the top level. > > In particular, it tries to unify those expressions with a few > different types, including IO. > > On the other hand, the let-expression is typed like

[Haskell-cafe] joyent, solaris and ghc

2008-09-02 Thread Jason Dusek
Is anyone on the list using GHC on Joyent's Solaris (x86_64) setup? If so, I would love to know whether it was easy/hard and what the process is. -- _jsn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] What monad am I in?

2008-09-02 Thread Ryan Ingram
ghci has some crazy defaulting rules for expressions at the top level. In particular, it tries to unify those expressions with a few different types, including IO. On the other hand, the let-expression is typed like regular Haskell and you run into the monomorphism restriction. -- ryan On Tue

Re: [Haskell-cafe] What monad am I in?

2008-09-02 Thread Marc Weber
> Have I, like Monsier Jourdain, been running in the IO monad all my > life, and didn't even know it? Sure, just try readFile "doesnotexist" within ghci :-) That's an IO action. on the other side ghci > (3+7) 10 is no IO action. So I think ghci has two default behaviours differing. Either its a mon

Re: [Haskell-cafe] What monad am I in?

2008-09-02 Thread Jonathan Cast
On Tue, 2008-09-02 at 20:25 +, Henry Laxen wrote: > Dear Group, > > When I fire up ghci and define: > > increment x = return (x+1) > > I can say: > Main> increment 1 > > and ghci dutifully replies 2. Also as expected, the type signature of > increment is: (Num a, Monad m) => a -> m a > >

[Haskell-cafe] What monad am I in?

2008-09-02 Thread Henry Laxen
Dear Group, When I fire up ghci and define: increment x = return (x+1) I can say: Main> increment 1 and ghci dutifully replies 2. Also as expected, the type signature of increment is: (Num a, Monad m) => a -> m a However, if I say: Main> let a = increment 1 I get: :1:8: Ambiguous type

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-09-02 Thread David Menendez
On Tue, Sep 2, 2008 at 4:19 PM, Ganesh Sittampalam <[EMAIL PROTECTED]> wrote: > On Tue, 2 Sep 2008, Ashley Yakeley wrote: >> >> It's worse than that. If you derive an instance of Typeable for your type, >> it means everyone else can peer into your constructor functions and other >> internals. Sure,

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-09-02 Thread Ganesh Sittampalam
On Tue, 2 Sep 2008, Adrian Hey wrote: Ganesh Sittampalam wrote: You see this as a requirement that can be discharged by adding the ACIO concept; I see it as a requirement that should be communicated in the type. Another way of looking at it is that Data.Unique has associated with it some con

[Haskell-cafe] Re: [Haskell] Top Level <-

2008-09-02 Thread Ganesh Sittampalam
On Tue, 2 Sep 2008, Ashley Yakeley wrote: Ganesh Sittampalam wrote: I have a feeling it might be non-trivial; the dynamically loaded bit of code will need a separate copy of the module in question, since it might be loaded into something where the module is not already present. Already the d

RE: [Haskell-cafe] Top Level <-

2008-09-02 Thread Sittampalam, Ganesh
David Roundy wrote: > On Tue, Sep 02, 2008 at 10:10:31AM +0100, Sittampalam, Ganesh wrote: >> Arguably both of these cases are not ACIO simply because of the >> non-termination effects, but it's not obvious to me how you tell just >> by looking at either one's code together with the declared A

Re: [Haskell-cafe] Top Level <-

2008-09-02 Thread David Roundy
On Tue, Sep 02, 2008 at 10:10:31AM +0100, Sittampalam, Ganesh wrote: > > > Contrived example follows: > > > > > module Module1 (mod1) where > > > import Module2 > > > > > > glob1 :: IORef Int > > > glob1 <- mod2 >>= newIORef > > > > > mod1 :: IO Int > > > mod1 = readIORef glob1 > > > > > module

Re: [haskell-cafe] Monad and kinds

2008-09-02 Thread Daniel Fischer
Am Dienstag, 2. September 2008 15:34 schrieb Ramin: > Hello, I'm new here, but in the short time I have known Haskell, I can > already say it's my favorite computer language. > > Except for monads, and no matter how many tutorials I read, I find the > only kind of monad I can write is the monad tha

[Haskell-cafe] ICFP09 Announcement

2008-09-02 Thread Matthew Fluet (ICFP Publicity Chair)
++ ANNOUNCEMENT The 14th ACM SIGPLAN International Conference on Functional Programming ICFP 2009 31st August - 2n

Re: [haskell-cafe] Monad and kinds

2008-09-02 Thread Jake Mcarthur
On Sep 2, 2008, at 8:34 AM, Ramin wrote: instance Monad Query where return (initState, someRecord) = Query (initState, someRecord) {- code for (>>=) -} GHC gives an error, "Expected kind `* -> *', but `Scanlist_ctrl' has kind `* -> * -> *' ". I believe you understand the proble

[haskell-cafe] Monad and kinds

2008-09-02 Thread Ramin
Hello, I'm new here, but in the short time I have known Haskell, I can already say it's my favorite computer language. Except for monads, and no matter how many tutorials I read, I find the only kind of monad I can write is the monad that I copied and pasted from the tutorial, i.e. I still don

Re: [Haskell-cafe] It's not a monad - what is it? looking for nice syntactic sugar, customizable do notation?

2008-09-02 Thread Yitzchak Gale
Oops, needed to convert one more >> into a comma: (rootElt ! [xmlns "http://www.w3.org/1999/xhtml"; ,lang "en-US" ,xml_lang "en-US" ]) $ concatXml etc. -Yitz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.h

Re: [Haskell-cafe] It's not a monad - what is it? looking for nice syntactic sugar, customizable do notation?

2008-09-02 Thread Yitzchak Gale
Marc Weber wrote: > (3) Third idea: > xmlWithInnerIO <- execXmlT $ do >xmlns "http://www.w3.org/1999/xhtml"; >> lang "en-US" >> xml:lang "en-US" >head $ title $ text "minimal" >body $ do > args <- lift $ getArgs > h1 $ text "minimal" > div $ text $ "args passed to this p

[Haskell-cafe] REMINDER: OpenSPARC project application deadline this Friday

2008-09-02 Thread Duncan Coutts
http://haskell.org/opensparc/ The deadline for applications for the Haskell OpenSPARC project is rapidly approaching. Applications have to be sent to: [EMAIL PROTECTED] by the end of this week, Friday the 5th September. If you want any comments on your application bef

[Haskell-cafe] Re: [Haskell] The initial view on typed sprintf and sscanf

2008-09-02 Thread ChrisK
Matthew Brecknell wrote: Unfortunately, I don't seem to be able to make the expected fprintf function, because printf's format-dependent parameter list makes it impossible to find a place to pass the handle. Hence the C++-like (<<) ugliness. How about this: fprintf :: Handle -> F (IO ()) b ->

[Haskell-cafe] Re: [Haskell] Top Level <-

2008-09-02 Thread Ashley Yakeley
Ganesh Sittampalam wrote: I have a feeling it might be non-trivial; the dynamically loaded bit of code will need a separate copy of the module in question, since it might be loaded into something where the module is not already present. Already the dynamic loader must load the module into the

RE: [Haskell-cafe] Top Level <-

2008-09-02 Thread Sittampalam, Ganesh
> > Contrived example follows: > > > module Module1 (mod1) where > > import Module2 > > > > glob1 :: IORef Int > > glob1 <- mod2 >>= newIORef > > > mod1 :: IO Int > > mod1 = readIORef glob1 > > > module Module2 (mod2) where > > import Module1 > > glob2 :: IORef Int > > glob2 <- mod1 >>= newIOR

Re: [Haskell-cafe] Top Level <-

2008-09-02 Thread Adrian Hey
Sittampalam, Ganesh wrote: Can't you write two recursive modules with <- that depend on each other, so that there's no valid initialisation order? Contrived example follows: module Module1 where glob1 :: IORef Int glob1 <- mod2 >>= newIORef mod1 :: IO Int mod1 = readIORef glob1 module Modu

RE: [Haskell-cafe] Top Level <-

2008-09-02 Thread Sittampalam, Ganesh
John Meacham wrote: On Fri, Aug 29, 2008 at 04:33:50PM -0700, Dan Weston wrote: >> C++ faced this very issue by saying that with global data, >> uniqueness of initialization is guaranteed but order of >> evaluation is not. Assuming that the global data are >> merely thunk wrappers over some commo

Re: [Haskell-cafe] Re: [Haskell] Top Level <-

2008-09-02 Thread Adrian Hey
Ganesh Sittampalam wrote: You see this as a requirement that can be discharged by adding the ACIO concept; I see it as a requirement that should be communicated in the type. Another way of looking at it is that Data.Unique has associated with it some context in which Unique values are safely c

Re: [Haskell-cafe] Research language vs. professional language

2008-09-02 Thread Manuel M T Chakravarty
Ryan Ingram: On Sun, Aug 31, 2008 at 7:27 PM, Jonathan Cast <[EMAIL PROTECTED]> wrote: This concept of `day-to-day work' is a curious one. Haskell is not a mature language, and probably shouldn't ever be one. I see where you are coming from here, but I think that train has already started and