[Haskell-cafe] Do you want to maintain bindings-DSL?

2013-09-13 Thread Maurício Antunes
Hi, bindings-DSL[1] is a stable and reliable macro package for FFI. It just got a new tutorial and its repository is now in git. If no one else wants to maintain it, I'll still be looking at issue reports and fixing possible problems, but I've not been actively using Haskell for some time, and won

Re: [Haskell-cafe] Do combinatorial algorithms have a matroid strucutre XOR non-matroid structure?

2013-07-14 Thread Brent Yorgey
On Thu, Jul 11, 2013 at 03:39:02PM -0700, KC wrote: > I ask this on this mailing list because there are quite a few > mathematically oriented people here. If you accept the Law of Excluded Middle, everything either has a matroid structure, or not. On the other hand, if you do not accept it, then

[Haskell-cafe] Do combinatorial algorithms have a matroid strucutre XOR non-matroid structure?

2013-07-11 Thread KC
I ask this on this mailing list because there are quite a few mathematically oriented people here. Casey -- -- Regards, KC ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Donn Cave
On Sat, Aug 4, 2012 at 7:05 AM, Alexander Solla wrote: > On Fri, Aug 3, 2012 at 11:34 PM, Matthew wrote: ... >> With do notation, I can write something like this: >> >> do >> foo <- callFoo x >> bar <- callBar x >> return (baz) >> ... > The short answer is to

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Matthew
On Sat, Aug 4, 2012 at 7:05 AM, Alexander Solla wrote: > > > On Fri, Aug 3, 2012 at 11:34 PM, Matthew wrote: >> >> I'm a somewhat experienced coder but I am relatively new to Haskell. >> I've got a question about whether a usage of do notation is idiomatic, >> or whether it's better to use patter

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Alexander Solla
On Fri, Aug 3, 2012 at 11:34 PM, Matthew wrote: > I'm a somewhat experienced coder but I am relatively new to Haskell. > I've got a question about whether a usage of do notation is idiomatic, > or whether it's better to use pattern matching. > > I've got two functions which take an input and retu

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Johan Holmquist
Also if you don't need foo and bar you can write: callFoo >> callBar >> return baz //Johan On Aug 4, 2012 8:36 AM, "Matthew" wrote: > I'm a somewhat experienced coder but I am relatively new to Haskell. > I've got a question about whether a usage of do notation is idiomatic, > or whether it's b

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Benjamin Edwards
The do notation in this instance yields a nice advantage: if you want to switch to a different monad to encapsulate failure you will meely need to swap out the type signature and your function will need no further work. On Aug 4, 2012 7:35 AM, "Matthew" wrote: > I'm a somewhat experienced coder b

[Haskell-cafe] do vs. pattern matching

2012-08-03 Thread Matthew
I'm a somewhat experienced coder but I am relatively new to Haskell. I've got a question about whether a usage of do notation is idiomatic, or whether it's better to use pattern matching. I've got two functions which take an input and return Maybe SomeType. If either returns Nothing, I also want t

Re: [Haskell-cafe] Do type classes have a partial order?

2011-11-14 Thread Ling Yang
It seems like you would, going by semantics of System F, where types with type variables name a certain subset of types, => constraints further restrict the types of the same "shape" (are they an independent kind of restriction?), so typeclass declarations with/without => specify a partial order o

[Haskell-cafe] Do type classes have a partial order?

2011-11-14 Thread Patrick Browne
Is there a partial order on Haskell type classes?If so, does it induce any quasi-order relation on types named in the instances?In the example below types C and D have the same operation fThanks,Patdata C = C deriving Showdata D = D deriving Showclass A t where f::t->t f t = t instance A C whereins

Re: [Haskell-cafe] do-re-mi

2011-08-25 Thread Andrew Coppin
On 25/08/2011 02:59 AM, Albert Y. C. Lai wrote: do, a block, a monad block rec, a knot tied in the block mu, a name that calls itself (mu is pronounced as me in modern Greek) forM_, a long long list to run SO, a state aborting threads (SO is stack overflow) la, a state to follow SO T's, tranforme

Re: [Haskell-cafe] do-re-mi

2011-08-24 Thread Ivan Lazar Miljenovic
On 25 August 2011 11:59, Albert Y. C. Lai wrote: > do, a block, a monad block > rec, a knot tied in the block > mu, a name that calls itself (mu is pronounced as me in modern Greek) > forM_, a long long list to run > SO, a state aborting threads (SO is stack overflow) > la, a state to follow SO >

[Haskell-cafe] do-re-mi

2011-08-24 Thread Albert Y. C. Lai
do, a block, a monad block rec, a knot tied in the block mu, a name that calls itself (mu is pronounced as me in modern Greek) forM_, a long long list to run SO, a state aborting threads (SO is stack overflow) la, a state to follow SO T's, tranformers of monads that will bring us back to do

Re: [Haskell-cafe] Do exist globally available hosting project services?

2011-05-06 Thread Ivan Lazar Miljenovic
2011/5/7 Facundo Domínguez : > Dear haskellers, > >  I was reading the terms of service of the Haskell Community Server > and found this statement: > > "Users residing in countries on the United States Office of Foreign > Assets Control sanction list, including Cuba, Iran, Libya, North > Korea, Sud

[Haskell-cafe] Do exist globally available hosting project services?

2011-05-06 Thread Facundo Domínguez
Dear haskellers, I was reading the terms of service of the Haskell Community Server and found this statement: "Users residing in countries on the United States Office of Foreign Assets Control sanction list, including Cuba, Iran, Libya, North Korea, Sudan and Syria, may not post or access CONTEN

Re: [Haskell-cafe] $ do?

2010-12-22 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/15/10 02:36 , Roman Cheplyaka wrote: > Regarding the rationale, I'm not so sure and I'd like to hear an > explanation from someone competent. But I assume it has something > to do with the fact that if you supply a 'do' argument, you cannot > sup

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Jonathan Geddes
I'd be really interested in learning the rationale behind those changes. I'm sure it wasn't done for capricious or arbitrary reasons, but I can't help but see it as a step back. --Jonathan Geddes (sent from android mobile) On Dec 21, 2010 8:47 AM, "Lauri Alanko" wrote: On Tue, Dec 21, 2010 at 0

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Johannes Waldmann
> everything you ask for already was in Haskell ages ago: those were the days ... where the method in "Functor" method was called "map", and "zero" was a method of, guess what, "MonadZero"... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org htt

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Lauri Alanko
On Tue, Dec 21, 2010 at 08:31:08AM -0700, Jonathan Geddes wrote: > I'd love for the compiler to give an error (or maybe just a warning) > in the case that I have a pattern match in a monad that just blows up > (throws an exception) on a pattern match failure. You will be interested to know that ev

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Jonathan Geddes
I'd love for the compiler to give an error (or maybe just a warning) in the case that I have a pattern match in a monad that just blows up (throws an exception) on a pattern match failure. Currently there's no way to know the behavior of failed pattern match failures without looking at the instanc

[Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread John Smith
Monads seem to use fail in one of three ways: -Regular monads leave it at the default definition of error -MonadPlus sometimes redefines it to mzero -IO redefines it to failIO Are there any other definitions of fail? If not, does the special case of IO really need a class-level definition, or c

Re: [Haskell-cafe] $ do?

2010-12-16 Thread Christian Maeder
Am 15.12.2010 08:36, schrieb Roman Cheplyaka: > * Jonathan Geddes [2010-12-14 19:59:14-0700] >> Quick question: >> >> Why do I need the $ in the following bits of code? >> >>> main = withSocketsDo $ do >>>--do something with sockets >> >>> foo = fromMaybe 0 $ do >>>--do something in the ma

Re: [Haskell-cafe] $ do?

2010-12-15 Thread Brandon Moore
> From: Roman Cheplyaka > Sent: Wed, December 15, 2010 1:36:55 AM > > * Jonathan Geddes [2010-12-14 19:59:14-0700] > > Quick question: > > > > Why do I need the $ in the following bits of code? > > > > > main = withSocketsDo $ do > > >--do something with sockets > > > > > foo = fromMay

Re: [Haskell-cafe] $ do?

2010-12-14 Thread Roman Cheplyaka
* Jonathan Geddes [2010-12-14 19:59:14-0700] > Quick question: > > Why do I need the $ in the following bits of code? > > > main = withSocketsDo $ do > >--do something with sockets > > > foo = fromMaybe 0 $ do > >--do something in the maybe monad > > I don't see (after admittedly only

[Haskell-cafe] $ do?

2010-12-14 Thread Jonathan Geddes
Quick question: Why do I need the $ in the following bits of code? > main = withSocketsDo $ do >--do something with sockets > foo = fromMaybe 0 $ do >--do something in the maybe monad I don't see (after admittedly only a minute or so thinking about it) where any grammar ambiguities woul

Re: [Haskell-cafe] Do expression definition

2010-09-13 Thread Ben Millwood
On Mon, Sep 13, 2010 at 8:21 AM, Alexander Kotelnikov wrote: > And, also, would it make any difference if > > > do {p <- e; stmts}      =       let ok p = do {stmts} >    ok _ = fail "..." >  in e >>= ok > > is redefined as "e >>= (\p -> do {stmts})"? This is the magic that allows pattern-match f

Re: [Haskell-cafe] Do expression definition

2010-09-13 Thread Michael Lazarev
2010/9/13 Henning Thielemann : > It means that variables bound by let, may be instantiated to different types > later. Can you give an example, please? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell-cafe] Do expression definition

2010-09-13 Thread Henning Thielemann
On Mon, 13 Sep 2010, Alexander Kotelnikov wrote: Hello. http://www.haskell.org/onlinereport/exps.html#sect3.14 a obscure (to me) note which says "As indicated by the translation of do, variables bound by let have fully polymorphic types while those defined by <- are lambda bound and are thu

[Haskell-cafe] Do expression definition

2010-09-13 Thread Alexander Kotelnikov
Hello. http://www.haskell.org/onlinereport/exps.html#sect3.14 a obscure (to me) note which says "As indicated by the translation of do, variables bound by let have fully polymorphic types while those defined by <- are lambda bound and are thus monomorphic." What actually does it mean? And, a

Re: [Haskell-cafe] Do I need to roll my own?

2010-03-31 Thread David Leimbach
On Wed, Mar 31, 2010 at 12:24 PM, David Leimbach wrote: > > > On Wed, Mar 31, 2010 at 12:02 PM, Gregory Collins > wrote: > >> David Leimbach writes: >> >> > to block or perhaps timeout, depending on the environment, looking for >> > "some String" on an input Handle, and it appears that iteratee

Re: [Haskell-cafe] Do I need to roll my own?

2010-03-31 Thread David Leimbach
On Wed, Mar 31, 2010 at 12:02 PM, Gregory Collins wrote: > David Leimbach writes: > > > to block or perhaps timeout, depending on the environment, looking for > > "some String" on an input Handle, and it appears that iteratee works > > in a very fixed block size. While a fixed block size is ok,

Re: [Haskell-cafe] Do I need to roll my own?

2010-03-31 Thread Gregory Collins
David Leimbach writes: > to block or perhaps timeout, depending on the environment, looking for > "some String" on an input Handle, and it appears that iteratee works > in a very fixed block size.  While a fixed block size is ok, if I can > put back unused bytes into the enumerator somehow (I may

[Haskell-cafe] Do I need to roll my own?

2010-03-31 Thread David Leimbach
I'm looking at iteratee as a way to replace my erroneous and really inefficient lazy-IO-based backend for an expect like Monad DSL I've been working for about 6 months or so now on and off. The problem is I want something like: expect "some String" send "some response" to block or perhaps timeou

Re: [Haskell-cafe] do we need types?

2010-02-26 Thread John Meacham
On Fri, Feb 26, 2010 at 04:23:52PM +0300, Miguel Mitrofanov wrote: > I'd say we don't really need subclasses. I mean, what's the difference: > > class Eq a where (==) :: a -> a -> Bool > instance Eq a => Eq (Maybe a) where > Nothing == Nothing = True > Just x == Just y = x == y > _ == _ = Fal

Re: [Haskell-cafe] do we need types?

2010-02-26 Thread Jason Dusek
This reminds me of an email posted to this list long ago by Luke Palmer, describing a use of records-as-interfaces in Agda. -- Jason Dusek -- Forwarded message -- From: Luke Palmer Date: 2009/12/29 Subject: Re: [Haskell-cafe] Alternatives to type classes. To: Jason Dusek

Re: [Haskell-cafe] do we need types?

2010-02-26 Thread Miguel Mitrofanov
s/subclasses/classes/ Sorry for the confusion. Miguel Mitrofanov wrote: I'd say we don't really need subclasses. I mean, what's the difference: class Eq a where (==) :: a -> a -> Bool instance Eq a => Eq (Maybe a) where Nothing == Nothing = True Just x == Just y = x == y _ == _ = False so

Re: [Haskell-cafe] do we need types?

2010-02-26 Thread Miguel Mitrofanov
I'd say we don't really need subclasses. I mean, what's the difference: class Eq a where (==) :: a -> a -> Bool instance Eq a => Eq (Maybe a) where Nothing == Nothing = True Just x == Just y = x == y _ == _ = False sort :: Eq a => [a] -> [a] or data Eq a = Eq {eq :: a -> a -> Bool} eqMayb

Re: [Haskell-cafe] do we need types?

2010-02-26 Thread Tom Lokhorst
Together with Sebastiaan Visser, I've been working on a library called AwesomePrelude [1]. This is a library where we try to reimplement the Prelude by replacing all concrete data types with type classes. This way you can have multiple implementations of a "data type". This is our current impleme

[Haskell-cafe] do we need types?

2010-02-26 Thread Pasqualino "Titto" Assini
Hi, just a silly question (or maybe more than one): In Haskell we have data types (Integer,[a],...) as well as type classes (Num, Ord...). But, if we have type classes do we still need types? Why shouldn't the objects that we process be defined only by their 'interfaces' (assuming that a type

Re: [Haskell-cafe] Do you need Windows USB in Haskell?

2009-12-06 Thread Paulo Tanimoto
Hi Mauricio, 2009/12/5 Maurí­cio CA : > > Problem is: I don't have a Windows machine where I could test > this. So, if you need USB in windows, please keep in touch. I > wouldn't ask you to write any code, but I need to know what builds > and what doesn't. > I don't need usb and I can't say I'm a

[Haskell-cafe] Do you need Windows USB in Haskell?

2009-12-05 Thread Maurí­cio CA
Hi, I keep this direct binding to libusb-1.0.x: http://hackage.haskell.org/package/bindings-libusb on top of which Bas maintains a nice USB library: http://hackage.haskell.org/package/usb Work has been done to support libusb-1.0.x in Windows. So, as long as my bindings-libusb works proper

Re: [Haskell-cafe] Do I have this right? "Remembering" Memoization!

2009-09-15 Thread Derek Elkins
> But pedantically even the function: > >> quux :: Int -> Int >> quux x = trace "Quux" (bar 12) > >> optmain :: IO () >> optmain = quux 10 `seq` quux 11 `seq` return () > > might print only once if GHC at the optimization level selected recognizes > that quux doesn't depend on its argument and rewr

Re: [Haskell-cafe] Do I have this right? "Remembering" Memoization!

2009-09-15 Thread Edward Kmett
I agree with what you meant, but not quite with what you said. To be pedantic: > import Debug.Trace > foo :: Int > foo = trace "Foo" (bar 12) > bar :: Int -> Int > bar x = trace "Bar" x > main :: IO () > main = foo `seq` foo `seq` return () main prints "Foo\nBar\n" showing that the bar is only

Re: [Haskell-cafe] Do I have this right? "Remembering" Memoization!

2009-09-13 Thread Mark Wotton
On 14/09/2009, at 9:28 AM, Casey Hawthorne wrote: Do I have this right? "Remembering" Memoization! For some applications, a lot of state does not to be saved, since "initialization" functions can be called early, and these functions will "remember" - (memoize) their results when called again

[Haskell-cafe] Do I have this right? "Remembering" Memoization!

2009-09-13 Thread Casey Hawthorne
Do I have this right? "Remembering" Memoization! For some applications, a lot of state does not to be saved, since "initialization" functions can be called early, and these functions will "remember" - (memoize) their results when called again, because of lazy evaluation? -- Regards, Casey __

[Haskell-cafe] Do you understand posix well?

2009-08-05 Thread Maurí­cio CA
I've beeing writing a low-level binding to posix that can be usefull if you want to use posix but has no time to learn FFI: http://hackage.haskell.org/package/bindings-posix However, my understandment of posix is barely nothing, and I see that many of its functionality is enabled or disabled by

Re: [Haskell-cafe] do nmergeIO or mergeIO preserve order?

2009-03-10 Thread Anatoly Yakovenko
> I would also consider it bad style to be fully polymorphic in this case, as > you require polymorphic seq, which is evil (though I don't have the space to > argue this right now :-).  Unamb would be bad style, also, since your > semantics are nondeterministic and so you wouldn't meet the precondi

Re: [Haskell-cafe] do nmergeIO or mergeIO preserve order?

2009-03-10 Thread Luke Palmer
Oh, you're right. Here are some thoughts. You want the list you get back to only contain values in WHNF. This differs from mergeIO & co., which are simply evaluating the spine of the list, and don't even look at the values. I would also consider it bad style to be fully polymorphic in this case

Re: [Haskell-cafe] do nmergeIO or mergeIO preserve order?

2009-03-10 Thread Anatoly Yakovenko
i think this would still force me to evailuate the whole list, right? i would want something that pipes the results into a channel that i can lazyly read as the results are available. On Tue, Mar 10, 2009 at 2:44 PM, Luke Palmer wrote: > I think nmergeIO . map (:[]) should do the trick. > > Luke

Re: [Haskell-cafe] do nmergeIO or mergeIO preserve order?

2009-03-10 Thread Luke Palmer
I think nmergeIO . map (:[]) should do the trick. Luke On Tue, Mar 10, 2009 at 3:41 PM, Anatoly Yakovenko wrote: > Hmm, yea, actually that makes sense. What i am looking for is > something that maps over a list and returns the list in order which > the values are evaluated. looks like i can im

Re: [Haskell-cafe] do nmergeIO or mergeIO preserve order?

2009-03-10 Thread Anatoly Yakovenko
Hmm, yea, actually that makes sense. What i am looking for is something that maps over a list and returns the list in order which the values are evaluated. looks like i can implement that pretty easily with unamb. On Tue, Mar 10, 2009 at 2:33 PM, Luke Palmer wrote: > Although it is not formally

Re: [Haskell-cafe] do nmergeIO or mergeIO preserve order?

2009-03-10 Thread Luke Palmer
Although it is not formally specified, my intuition for the specification is that order is preserved within each of the lists. Luke On Tue, Mar 10, 2009 at 2:50 PM, Anatoly Yakovenko wrote: > do nmergeIO or mergeIO preserve order? or not preserve order? >

[Haskell-cafe] do nmergeIO or mergeIO preserve order?

2009-03-10 Thread Anatoly Yakovenko
do nmergeIO or mergeIO preserve order? or not preserve order? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-07 Thread Martijn van Steenbergen
Derek Elkins wrote: If you are doing something else, use something else. This makes it clear that you -aren't- going to break out (non-exceptionally), i.e. the control flow is more obvious in this code than in the other versions. Oh yes, of course! I wasn't saying forever is bad; in fact I agr

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-07 Thread Derek Elkins
On Sat, 2009-03-07 at 23:12 +0100, Martijn van Steenbergen wrote: > Derek Elkins wrote: > > Both are poorish style. > > > > reader <- forkIO $ forever $ do (nr', line) <- readChan; when (nr /= nr') $ > > putStrLn hdl line > > This is fine assuming you always want to re-enter the loop. If you wan

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-07 Thread Martijn van Steenbergen
Derek Elkins wrote: Both are poorish style. reader <- forkIO $ forever $ do (nr', line) <- readChan; when (nr /= nr') $ putStrLn hdl line This is fine assuming you always want to re-enter the loop. If you want to loop conditionally (which is most often the case), forever isn't going to work

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-06 Thread Luke Palmer
On Fri, Mar 6, 2009 at 1:48 AM, Daryoush Mehrtash wrote: > Question: Do I need to worry about space leak if I am using the fix to > instead of the "let"? If you need to worry about a space leak with fix, you need to worry about it with let. The reason arrows can tie the loop tighter is more ab

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-06 Thread Andrea Vezzosi
2009/3/6 Daryoush Mehrtash : > Two questions: > > a)   This  chat server implementation doesn't actually close the connection > as a real one would need to do.  If you use "forever"  is there a way to end > the loop so as to end the connection? Yes, throw an exception and catch it from outside the

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-06 Thread Lennart Augustsson
Personally I would not use fix. I don't think it improves readability. -- Lennart 2009/3/5 Daryoush Mehrtash : > In this chat server implementation > http://www.haskell.org/haskellwiki/Implement_a_chat_server > > forkIO is used with fix as in: > > reader <- forkIO $ fix $ \loop -> do > >

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-06 Thread Daryoush Mehrtash
Two questions: a) This chat server implementation doesn't actually close the connection as a real one would need to do. If you use "forever" is there a way to end the loop so as to end the connection? b) In Section 5 of this paper: http://www.cs.yale.edu/~hl293/download/leak.pdf Comparing t

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-05 Thread Luke Palmer
On Thu, Mar 5, 2009 at 6:27 PM, Donn Cave wrote: > Quoth Jonathan Cast : > > > You can certainly use let: > > > > reader <- forkIO $ let loop = do > > (nr', line) <- readChan chan' > > when (nr /= nr') $ hPutStrLn hdl line > > loop > > in loop > > > > But the version with

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-05 Thread Donn Cave
Quoth Jonathan Cast : > You can certainly use let: > > reader <- forkIO $ let loop = do > (nr', line) <- readChan chan' > when (nr /= nr') $ hPutStrLn hdl line > loop > in loop > > But the version with fix is clearer (at least to people who have fix in > their vocabulary) a

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-05 Thread Derek Elkins
On Thu, 2009-03-05 at 16:12 -0800, Jonathan Cast wrote: > On Thu, 2009-03-05 at 15:36 -0800, Daryoush Mehrtash wrote: > > In this chat server implementation > > http://www.haskell.org/haskellwiki/Implement_a_chat_server > > > > forkIO is used with fix as in: > > > > reader <- forkIO $ fix $ \loop

Re: [Haskell-cafe] do you have to use fix with forkio?

2009-03-05 Thread Jonathan Cast
On Thu, 2009-03-05 at 15:36 -0800, Daryoush Mehrtash wrote: > In this chat server implementation > http://www.haskell.org/haskellwiki/Implement_a_chat_server > > forkIO is used with fix as in: > > reader <- forkIO $ fix $ \loop -> do > > (nr', line) <- readChan chan' > when (nr /

[Haskell-cafe] do you have to use fix with forkio?

2009-03-05 Thread Daryoush Mehrtash
In this chat server implementation http://www.haskell.org/haskellwiki/Implement_a_chat_server forkIO is used with fix as in: reader <- forkIO $ fix $

Re: [Haskell-cafe] Do I need an account to report build ofHacakgepackages?

2008-11-22 Thread Claus Reinke
Any compromised uploader machine with stored passwords can be used to upload compromising code, which will propagate to all downloaders. It doesn't really matter whether a compromised machine stores a password or not. If you upload anything using a compromised machine, the attacker has the opp

Re: [Haskell-cafe] Do I need an account to report build of Hacakgepackages?

2008-11-22 Thread Antti-Juhani Kaijanaho
On Sat, Nov 22, 2008 at 03:11:34PM -, Claus Reinke wrote: >> You only need an account for uploading packages. If you do not want to >> have to enter your user name or password interactively when you run >> "cabal upload" then you can put them in the config file: >> >> username: >> password: > >

Re: [Haskell-cafe] Do I need an account to report build of Hacakgepackages?

2008-11-22 Thread Duncan Coutts
On Sat, 2008-11-22 at 15:11 +, Claus Reinke wrote: > > You only need an account for uploading packages. If you do not want to > > have to enter your user name or password interactively when you run > > "cabal upload" then you can put them in the config file: > > > > username: > > password: >

Re: [Haskell-cafe] Do I need an account to report build of Hacakgepackages?

2008-11-22 Thread Claus Reinke
You only need an account for uploading packages. If you do not want to have to enter your user name or password interactively when you run "cabal upload" then you can put them in the config file: username: password: That sounds like a very bad idea, and should not be encouraged! Any compromised

Re: [Haskell-cafe] Do I need an account to report build of Hacakge packages?

2008-11-22 Thread Duncan Coutts
On Fri, 2008-11-21 at 16:12 -0800, Ahn, Ki Yung wrote: > I am just curious about how cabal report works. > > I recently figured out that there is a report command in cabal and it > reports the reports generated by --build-reports option when building a > package. > > Is this because I don't have

[Haskell-cafe] Do I need an account to report build of Hacakge packages?

2008-11-21 Thread Ahn, Ki Yung
I am just curious about how cabal report works. I recently figured out that there is a report command in cabal and it reports the reports generated by --build-reports option when building a package. Is this because I don't have an account on Hackage yet, or because of some other reasons? And if

[Haskell-cafe] do like notation works fine when using ghc head

2008-09-12 Thread Marc Weber
> There is also the combinator approach of Text.Html, which > gives you a syntax similar to (3) but without abusing "do": > > (rootElt ! [xmlns "http://www.w3.org/1999/xhtml";, >lang "en-US" >> xml:lang "en-US"]) $ concatXml > [head $ title $ text "minimal" > ,body $ concatXml >

[Haskell-cafe] do and ifthenelse indentation in GHC

2008-06-19 Thread Stefan Monnier
http://hackage.haskell.org/trac/haskell-prime/wiki/DoAndIfThenElse says (and my memory seems to agree) that GHC has been changed to accept things like readnums f n = do eof <- hIsEOF f if eof then return n else do l <- hGetLine f

Re: [Haskell-cafe] do construct in wxhaskell

2008-04-12 Thread Abhay Parvate
The indentation is not right; all the statements after the 'do' keyword need to start exactly at the same column. In particular, the 'f' in fileContent and 's' in set should be one below the other. And the 'return ()' also seems to be displaced; perhaps you want that also exactly below the last 'se

[Haskell-cafe] do construct in wxhaskell

2008-04-11 Thread Jodi-Ann Prince
hi, im working ona project, and im having problem loading some code in wxhaskell: onOpen :: Frame a -> TextCtrl b -> MenuItem c -> StatusField -> IO () onOpen f sw mclose status = do mbfname <- fileOpenDialog f False True "Open image" fileTypes "" ""

Re: [Haskell-cafe] Do real programs need IO? (was IO is a bad example for Monads)

2007-12-09 Thread Daniel Fischer
Just darcs got TV and read the sources. Awesome stuff! But what do I find in Interface.TV.IO ? -- | 'Input' version of 'getContents' contentsIn :: Input IO String contentsIn = iPrim getContents -- | 'Input' version of 'readFile' fileIn :: FilePath -> Input IO String fileIn name = iPrim (readFile

Re: [Haskell-cafe] Do real programs need IO? (was IO is a bad example for Monads)

2007-12-09 Thread Lennart Augustsson
Maybe I'm exaggerating, but it's true for 96% of all programs. (96% is with a :-)) I did not express anything that was meant to be a perpetual truth, only best practice at the moment. For a living I write programs that are almost without interaction with the outside world. Still, I need a to spen

Re: [Haskell-cafe] Do real programs need IO? (was IO is a bad example for Monads)

2007-12-09 Thread Conal Elliott
Thanks for the clarification. >AFAIK, the only way to get input and produce output is via the IO monad Now you know something different, don't you? FRP, Pan, TV. Also Grapefruit, functional forms, and others I'm not thinking of or don't know about. As for your example, mixing the IO with the f

Re: [Haskell-cafe] Do real programs need IO? (was IO is a bad example for Monads)

2007-12-09 Thread Daniel Fischer
Am Sonntag, 9. Dezember 2007 21:29 schrieb Conal Elliott: > I think your real point is that some things we still haven't figured out > how to express functionally. Right? That's my point, at least. Currently, AFAIK, the only way to get input and produce output is via the IO monad, so it is de fa

Re: [Haskell-cafe] Do real programs need IO? (was IO is a bad example for Monads)

2007-12-09 Thread Conal Elliott
I think your real point is that some things we still haven't figured out how to express functionally. Right? I would certainly agree with that part. Perhaps you exaggerating when you wrote "IO is important because you can't write any real program without using it." Cheers, - Conal On Dec 9, 200

Re: [Haskell-cafe] Do real programs need IO? (was IO is a bad example for Monads)

2007-12-09 Thread Lennart Augustsson
Conal, I think TV etc. is fantastic stuff, but that mean that we cannot, say, invoke an external program in Haskell until someone has figured out a composable library for this? I sincerely hope someone will, but the only way we have right now is the ugly IO monad. -- Lennart On Dec 9, 2007 7:2

[Haskell-cafe] Do real programs need IO? (was IO is a bad example for Monads)

2007-12-09 Thread Conal Elliott
On Dec 9, 2007 10:07 AM, Daniel Fischer <[EMAIL PROTECTED]> wrote: > Interactive programmes without using IO? Cool :) And how! > I think you misunderstood Lennart. Thanks for checking. In this case, I think I understood Lennart fine and that he was saying what you're saying. > Would you deny

Re: [Haskell-cafe] do... error

2007-12-08 Thread Felipe Lessa
On Dec 9, 2007 1:01 AM, Ryan Bloor <[EMAIL PROTECTED]> wrote: > But what is the right way to indent...? It is so annoying, why does it > matter so much! :( You may read http://en.wikibooks.org/wiki/Haskell/Indentation which tries to explain in a very simple language. -- Felipe.

Re: [Haskell-cafe] do... error

2007-12-08 Thread Felipe Lessa
On Dec 9, 2007 12:42 AM, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]> wrote: > I neglected to say the proper indentation: > >test = do x <- item > item -- note, indented to match the token after > the "do" > y <- item > return (x,y) That is the b

Re: [Haskell-cafe] do... error

2007-12-08 Thread Brandon S. Allbery KF8NH
On Dec 8, 2007, at 21:40 , Brandon S. Allbery KF8NH wrote: On Dec 8, 2007, at 21:38 , Ryan Bloor wrote: test :: Parser (Char,Char) test = do x <- item item The second and subsequent lines are indented too much, so are read as a continuation of the first; which, starting

Re: [Haskell-cafe] do... error

2007-12-08 Thread Brandon S. Allbery KF8NH
On Dec 8, 2007, at 21:38 , Ryan Bloor wrote: test :: Parser (Char,Char) test = do x <- item item The second and subsequent lines are indented too much, so are read as a continuation of the first; which, starting with "x <- ", is not an expression. -- brandon s. allbery

[Haskell-cafe] do... error

2007-12-08 Thread Ryan Bloor
hi test :: Parser (Char,Char) test = do x <- item item y <- item return (x,y) How come this brings an error saying that after do {} it must end with an expression. Ryan _ Get free

Re: [Haskell-cafe] do notation strangeness

2007-12-08 Thread Ilya Tsindlekht
On Sat, Dec 08, 2007 at 03:28:58PM -0200, Felipe Lessa wrote: > On Dec 8, 2007 3:12 PM, Ilya Tsindlekht <[EMAIL PROTECTED]> wrote: > > On Sat, Dec 08, 2007 at 02:59:16PM -0200, Felipe Lessa wrote: > > > Prelude> do {1 <- return 3; return' "ok"} > > > Nothing > > > Prelude> return 3 >>= \1 -> return

Re: [Haskell-cafe] do notation strangeness

2007-12-08 Thread Felipe Lessa
On Dec 8, 2007 3:12 PM, Ilya Tsindlekht <[EMAIL PROTECTED]> wrote: > On Sat, Dec 08, 2007 at 02:59:16PM -0200, Felipe Lessa wrote: > > Prelude> do {1 <- return 3; return' "ok"} > > Nothing > > Prelude> return 3 >>= \1 -> return' "ok" > > *** Exception: :1:13-30: Non-exhaustive patterns in lambda >

Re: [Haskell-cafe] do notation strangeness

2007-12-08 Thread Ilya Tsindlekht
On Sat, Dec 08, 2007 at 02:59:16PM -0200, Felipe Lessa wrote: > Hello! > > I see from > http://www.haskell.org/haskellwiki/Monads_as_computation#Do_notation > that > > do { v <- x ; } > = x >>= \v -> do { } > > However, look at this GHCi session: > > Prelude> let return' = return :: a -> M

Re: [Haskell-cafe] do notation strangeness

2007-12-08 Thread Felipe Lessa
On Dec 8, 2007 3:03 PM, Stefan O'Rear <[EMAIL PROTECTED]> wrote: > That rule only applies when v is an irrefutable pattern. The Haskell > Report lists the full rule. That's enlightening! Thank you, -- Felipe. ___ Haskell-Cafe mailing list Haskell-Caf

Re: [Haskell-cafe] do notation strangeness

2007-12-08 Thread Stefan O'Rear
On Sat, Dec 08, 2007 at 02:59:16PM -0200, Felipe Lessa wrote: > Hello! > > I see from > http://www.haskell.org/haskellwiki/Monads_as_computation#Do_notation > that > > do { v <- x ; } > = x >>= \v -> do { } > > Something seems wrong to me here. What am I missing? That rule only applies whe

[Haskell-cafe] do notation strangeness

2007-12-08 Thread Felipe Lessa
Hello! I see from http://www.haskell.org/haskellwiki/Monads_as_computation#Do_notation that do { v <- x ; } = x >>= \v -> do { } However, look at this GHCi session: Prelude> let return' = return :: a -> Maybe a Prelude> do {1 <- return 1; return' "ok"} Just "ok" Prelude> return 1 >>= \1 ->

Re: [Haskell-cafe] do

2007-12-03 Thread Dan Piponi
On Dec 3, 2007 1:09 PM, Denis Bueno <[EMAIL PROTECTED]> wrote: > I don't think I can conclude that there are *no* reasons to teach the > do-notation first. I just think that it is more instructive to teach > it later. It's standard in mathematics teaching, when introducing a mathematical structu

Re: [Haskell-cafe] do

2007-12-03 Thread Denis Bueno
On 03 Dec 2007, at 13:25 , Tim Newsham wrote: Probably one should understand how to use monads before worrying about the do-notation. Here are some references: I don't totally agree. You can teach monads to beginners just fine using the do-notation. Unsuprisingly its very much like teach

Re: [Haskell-cafe] do

2007-12-03 Thread Tim Newsham
Probably one should understand how to use monads before worrying about the do-notation. Here are some references: I don't totally agree. You can teach monads to beginners just fine using the do-notation. Unsuprisingly its very much like teaching monads using bind. You describe a two line do-

Re: [Haskell-cafe] do

2007-12-03 Thread Cale Gibbard
There are a few rules by which do-syntax is translated into a chain of bind (>>=) operations: They are, (approximately): do { x } = x do { x ; } = x >> do { } do { v <- x ; } = x >>= \v -> do { } do { let { } ; } = let in do { } The meaning of >>= depends on which monad you're using. I'

Re: [Haskell-cafe] do

2007-12-03 Thread Denis Bueno
On Dec 3, 2007 6:55 AM, PR Stanley <[EMAIL PROTECTED]> wrote: > Hi > I've probably asked about the do construct, if that's the right > label. Unfortunately I'm still not quite sure of its role and more > specifically its syntax. Something to do with generators perhaps? A > description plus some exa

[Haskell-cafe] do

2007-12-03 Thread PR Stanley
Hi I've probably asked about the do construct, if that's the right label. Unfortunately I'm still not quite sure of its role and more specifically its syntax. Something to do with generators perhaps? A description plus some examples would be most gratefully received. Thanks, Paul

  1   2   >