Re: [Haskell-cafe] Template Haskell sees into abstract data types

2010-07-03 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/4/10 00:29 , Ivan Lazar Miljenovic wrote: > David Menendez writes: >> I believe the point is that Template Haskell can see the internal >> structure of a type even when the constructors are not exported. The >> question is whether or not that is

Re: [Haskell-cafe] Template Haskell sees into abstract data types

2010-07-03 Thread Ivan Lazar Miljenovic
David Menendez writes: > I believe the point is that Template Haskell can see the internal > structure of a type even when the constructors are not exported. The > question is whether or not that is intentional. I was under the impression that the question was whether the hiding of the construct

Re: [Haskell-cafe] Rank2Types and pattern matching

2010-07-03 Thread Dan Doel
On Saturday 03 July 2010 10:52:31 pm Felipe Lessa wrote: > I understood your explanation. However, is this an implementation > detail/bug or is it an intended feature? Well, I wouldn't call it a bug. Perhaps it could be called a lack of a feature, because one can imagine such pattern matches bei

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Mark Lentczner
I suppose that what qualifies as a good Haskell candidate depends on what you are looking for in a software engineer in general. For my part, having hired engineers into various groups over the last 20+ years, I've always preferred to hire people who demonstrate a broad understanding of computin

Re: [Haskell-cafe] Rank2Types and pattern matching

2010-07-03 Thread Felipe Lessa
Hello! On Sat, Jul 3, 2010 at 9:12 PM, Dan Doel wrote: > The problem is instantiation. SomeMonad is a constructor for the type > >  SomeMonad s a > > for any *particular* s and a. But the type: > >  forall s. SomeMonad s a > > is not that type. That type doesn't have constructors (proper) at all,

Re: [Haskell-cafe] checking types with type families

2010-07-03 Thread Kevin Quick
On Sat, 03 Jul 2010 13:28:44 -0700, Dan Doel wrote: As a side note, although I agree it abuses the fundeps intent, it was handy for the specific purpose I was implementing to have a "no-op/passthrough" instance of op. In general I like the typedef approach better, but it

Re: [Haskell-cafe] Template Haskell sees into abstract data types

2010-07-03 Thread David Menendez
On Sat, Jul 3, 2010 at 7:20 PM, Ivan Lazar Miljenovic wrote: > Serguey Zefirov writes: > I cannot directly create my own class instances for them because of that. But I found that I can write Template Haskell code that could do that - those data types could be reified just fine. >

Re: [Haskell-cafe] understanding Peano

2010-07-03 Thread Daniel Fischer
On Sunday 04 July 2010 01:27:19, Patrick Browne wrote: > Hi, > I would like to understand the Peano module below. > I do wish to implement or improve the code. > I am unsure of the semantics of (suc = Suc) and then the subsequent use > of (Suc n) > Is this an example of type-level programming? No

Re: [Haskell-cafe] Rank2Types and pattern matching

2010-07-03 Thread Dan Doel
On Saturday 03 July 2010 7:24:17 pm Yves Parès wrote: > I'm trying to implement the type protection used by ST to prevent a monad > from returning a certain type. > There's my code: > > import Control.Monad.Identity > > newtype SomeMonad s a = SomeMonad { unSome :: Identity a } > deriving (Mona

Re: [Haskell-cafe] understanding Peano

2010-07-03 Thread Andrew Korzhuev
Hi, I would like to understand the Peano module below. I do wish to implement or improve the code. I am unsure of the semantics of (suc = Suc) and then the subsequent use of (Suc n) Look's like author would like to declare an increment function instead of suc lately. Is this an example of

Re: [Haskell-cafe] More experiments with ATs

2010-07-03 Thread Sjoerd Visscher
On Jul 3, 2010, at 4:39 PM, Andrew Coppin wrote: > class Container c => Functor c where > fmap :: (Functor cx, Functor cy, Element cx ~ x, Element cy ~ y) => (x -> > y) -> (cx -> cy) > > However, this fails horribly: The type signature fails to mention c. You have to mention c, this means an

Re: [Haskell-cafe] Rank2Types and pattern matching

2010-07-03 Thread Jason Dagit
On Sat, Jul 3, 2010 at 4:24 PM, Yves Parès wrote: > Hello everybody, > > I'm trying to implement the type protection used by ST to prevent a monad > from returning a certain type. > There's my code: > > import Control.Monad.Identity > > newtype SomeMonad s a = SomeMonad { unSome :: Identity a } >

Re: [Haskell-cafe] understanding Peano

2010-07-03 Thread aditya siram
For me the easiest way to understand something like this is to follow the transformations of the code. Here's how your examples evaluate: > let t1 = plus (Suc (Zero)) (Suc ( Suc (Zero))) t1 = plus (Suc (Zero)) (Suc ( Suc (Zero))) = Suc (plus (Suc (Zero)) (Suc (Zero))) = Suc (Suc (plus (Suc

Re: [Haskell-cafe] Monad transformers

2010-07-03 Thread Mike Dillon
begin Andrew Coppin quotation: > Roman Cheplyaka wrote: > >See above: > >-- Dynamic components may be retrieved with 'get', static components > >-- with 'ask'. > > > >So you use ask to get some configuration variable (reader monad is used > >for configuration in xmonad) and get/put/modify to deal w

Re: [Haskell-cafe] Monad transformers

2010-07-03 Thread Evan Laforge
> As I say, every time I've tried to do this, I end up writing a function to > "run this stuff", and it typically takes a few hours to reach the point > where it type-checks. It took me a while the first time, but then I just learned the pattern and I do it that way every time. Here's my pattern:

[Haskell-cafe] understanding Peano

2010-07-03 Thread Patrick Browne
Hi, I would like to understand the Peano module below. I do wish to implement or improve the code. I am unsure of the semantics of (suc = Suc) and then the subsequent use of (Suc n) Is this an example of type-level programming? module Peano where data Nat = Zero | Suc Nat deriving Show class Pe

[Haskell-cafe] Rank2Types and pattern matching

2010-07-03 Thread Yves Parès
Hello everybody, I'm trying to implement the type protection used by ST to prevent a monad from returning a certain type. There's my code: import Control.Monad.Identity newtype SomeMonad s a = SomeMonad { unSome :: Identity a } deriving (Monad) newtype SomeType s = SomeType Int runSomeMonad

Re: [Haskell-cafe] Template Haskell sees into abstract data types

2010-07-03 Thread Ivan Lazar Miljenovic
Serguey Zefirov writes: >>> I cannot directly create my own class instances for them because of >>> that. But I found that I can write Template Haskell code that could do >>> that - those data types could be reified just fine. >> Huh? Sure you can write class instances for them. >> , >> | in

Re: [Haskell-cafe] Template Haskell sees into abstract data types

2010-07-03 Thread Serguey Zefirov
>> I cannot directly create my own class instances for them because of >> that. But I found that I can write Template Haskell code that could do >> that - those data types could be reified just fine. > Huh? Sure you can write class instances for them. > , > | instance SizeOf (Map k v) where >

Re: [Haskell-cafe] Template Haskell sees into abstract data types

2010-07-03 Thread Ivan Lazar Miljenovic
Serguey Zefirov writes: > Data.Map.Map and Data.Set.Set are exported abstractly, without > exposing knowledge about their internal structure. > > I cannot directly create my own class instances for them because of > that. But I found that I can write Template Haskell code that could do > that - t

Re: [Haskell-cafe] What is the point of many and some functions in Control.Applicative (for Alternative?)

2010-07-03 Thread Philippa Cowderoy
On 03/07/2010 21:11, Stephen Tetley wrote: For an applicative parser - many is the same combinator as Parsec's many and some is many1. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Exce

Re: [Haskell-cafe] Monad transformers

2010-07-03 Thread Andrew Coppin
Roman Cheplyaka wrote: * Andrew Coppin [2010-07-03 15:07:17+0100] In my experience, defining a type representing several stacked monad transformers is the easy part. Of course it is. It wasn't my intention just to show you how easy it is to define a newtype in Haskell :) I just showe

[Haskell-cafe] Template Haskell sees into abstract data types

2010-07-03 Thread Serguey Zefirov
Data.Map.Map and Data.Set.Set are exported abstractly, without exposing knowledge about their internal structure. I cannot directly create my own class instances for them because of that. But I found that I can write Template Haskell code that could do that - those data types could be reified just

Re: [Haskell-cafe] checking types with type families

2010-07-03 Thread Dan Doel
On Saturday 03 July 2010 4:01:12 pm Kevin Quick wrote: > As a side note, although I agree it abuses the fundeps intent, it was handy > for the specific purpose I was implementing to have a "no-op/passthrough" > instance of op. In general I like the typedef approach better, but it > looks like I mu

Re: [Haskell-cafe] What is the point of many and some functions in Control.Applicative (for Alternative?)

2010-07-03 Thread Stephen Tetley
For an applicative parser - many is the same combinator as Parsec's many and some is many1. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] What is the point of many and some functions in Control.Applicative (for Alternative?)

2010-07-03 Thread Dan Doel
On Saturday 03 July 2010 3:57:34 pm Thomas Hartman wrote: > When I load up Control.Applicative in ghci and try, eg > > many [1,2] or many (Just 1) or some [1,2] or some (Just 1) > > this never returns. > > What are the practical uses of these combinators, or for using the > Alternative class in

Re: [Haskell-cafe] checking types with type families

2010-07-03 Thread Kevin Quick
On Sat, 03 Jul 2010 12:48:56 -0700, Dan Doel wrote: Then the instance declares infinitely many instances C Bool a a. This is a violation of the fundep. Based on your error message, it looks like it ends up treating the instance as the first concrete 'a' it comes across, but who knows? Hmmm..

Re: [Haskell-cafe] cereal vs. binary

2010-07-03 Thread Alexey Khudyakov
On Sat, Jul 3, 2010 at 10:54 PM, Alexey Khudyakov wrote: > On Sat, Jul 3, 2010 at 8:57 PM, braver wrote: >> I dump results of a computation as a Data.Trie of [(Int,Float)].  It >> contains about 5 million entries, with the lists of 35 or less pairs >> each.  It takes 8 minutes to load with Data.B

[Haskell-cafe] What is the point of many and some functions in Control.Applicative (for Alternative?)

2010-07-03 Thread Thomas Hartman
When I load up Control.Applicative in ghci and try, eg many [1,2] or many (Just 1) or some [1,2] or some (Just 1) this never returns. What are the practical uses of these combinators, or for using the Alternative class in general? ___ Haskell-Cafe mail

Re: [Haskell-cafe] checking types with type families

2010-07-03 Thread Dan Doel
On Saturday 03 July 2010 2:11:37 pm David Menendez wrote: > > {-# LANGUAGE MultiParamTypeClasses #-} > > {-# LANGUAGE FunctionalDependencies #-} > > {-# LANGUAGE FlexibleInstances, UndecidableInstances #-} > > > > class C a b c | a -> b, a -> c where > >op :: a -> b -> c > > > > instance C Bo

Re: [Haskell-cafe] Monad transformers

2010-07-03 Thread Roman Cheplyaka
* Andrew Coppin [2010-07-03 15:07:17+0100] > Roman Cheplyaka wrote: > >* Andrew Coppin [2010-07-03 14:20:14+0100] > >>In my experience, using more than one monad transformer at once makes > >>code utterly incomprehensible. > > > >See X monad (xmonad) for an counterexample. > > > >-- | The X monad

Re: [Haskell-cafe] cereal vs. binary

2010-07-03 Thread Alexey Khudyakov
On Sat, Jul 3, 2010 at 8:57 PM, braver wrote: > I dump results of a computation as a Data.Trie of [(Int,Float)].  It > contains about 5 million entries, with the lists of 35 or less pairs > each.  It takes 8 minutes to load with Data.Binary and lookup a single > key.  What can take so long?  If I

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Yves Parès
Back to initial topic, I have a sudden fear: do you have to master Template Haskell so as to be regarded as a guru :-{ ? Let it be no, please, let it be no... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/h

Re: [Haskell-cafe] checking types with type families

2010-07-03 Thread David Menendez
On Sat, Jul 3, 2010 at 3:32 AM, Kevin Quick wrote: > On Wed, 23 Jun 2010 00:14:03 -0700, Simon Peyton-Jones > wrote: > >> I'm interested in situations where you think fundeps work and type >> families don't.  Reason: no one knows how to make fundeps work cleanly with >> local type constraints (su

Re: [Haskell-cafe] cereal vs. binary

2010-07-03 Thread Don Stewart
deliverable: > I dump results of a computation as a Data.Trie of [(Int,Float)]. It > contains about 5 million entries, with the lists of 35 or less pairs > each. It takes 8 minutes to load with Data.Binary and lookup a single > key. What can take so long? If I change from compressed to > uncomp

[Haskell-cafe] cereal vs. binary

2010-07-03 Thread braver
I dump results of a computation as a Data.Trie of [(Int,Float)]. It contains about 5 million entries, with the lists of 35 or less pairs each. It takes 8 minutes to load with Data.Binary and lookup a single key. What can take so long? If I change from compressed to uncompressed (and then decode

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/3/10 07:25 , Ivan Lazar Miljenovic wrote: > Mihai Maruseac writes: >> As a matter of fact, all of my Haskell codes didn't even touch monads. >> I always tried to write code as simple as possible and as >> understandable as possible (mainly for te

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/3/10 08:01 , Bulat Ziganshin wrote: > so, the main catch for C part were OS-specific calls like > GetPhysicalMemory - i spent lot of time reading mans. for Haskell > part, main changes were about default directories Even without libraries, if you

Re: [Haskell-cafe] How easy is it to hire Haskell programmers

2010-07-03 Thread Duncan Coutts
On Fri, 2010-07-02 at 09:43 -0400, Edward Kmett wrote: > > * How many applications did you get? > > I tend to actively recruit rather than throw open the floodgates. We did that initially. We are now very pleased that we switched track to openly advertising. We've had many excellent peo

Re: [Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Stephen Tetley
On 3 July 2010 15:04, Andrew Coppin wrote: > > I said "does something that doesn't fall under one of these". The identity > monad, by contrast, does nothing that does fall under these. :-P (It falls > under zero of these.) Okay, how about: The probability monad The powerset monad The monad of

Re: [Haskell-cafe] More experiments with ATs

2010-07-03 Thread Stephen Tetley
Hello Andrew The non-type-changing map is sometimes useful as a type class - in my graphics lib Wumpus, I call it pointwise: class Pointwise sh where type Pt sh :: * pointwise :: (Pt sh -> Pt sh) -> sh -> sh For the graphics I want objects to be parametric on unit (which is usually Double)

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Felipe Lessa
On Sat, Jul 3, 2010 at 10:15 AM, Ivan Lazar Miljenovic wrote: > Felipe Lessa writes: >> There are many many other useful C libraries that we should have >> bindings to.  For example, Hackage doesn't have any MPI bindings. >> Could we write an MPI client in Haskell?  I guess so.  Is it worth it? >

Re: [Haskell-cafe] More experiments with ATs

2010-07-03 Thread Ivan Lazar Miljenovic
Andrew Coppin writes: > Currently we have > > class Functor c where >fmap :: (x -> y) -> (c x -> c y) > > This relies on c having kind * -> *. For example, Bytestring cannot be > an instance of Functor. > > A cleaner solution would be to have something like > > class Container c where >

[Haskell-cafe] More experiments with ATs

2010-07-03 Thread Andrew Coppin
Currently we have class Functor c where fmap :: (x -> y) -> (c x -> c y) This relies on c having kind * -> *. For example, Bytestring cannot be an instance of Functor. A cleaner solution would be to have something like class Container c where type Element c :: * I then attempted to

Re: [Haskell-cafe] How easy is it to hire Haskell programmers

2010-07-03 Thread Duncan Coutts
On 2 July 2010 11:56, JP Moresmau wrote: > > On Fri, Jul 2, 2010 at 12:34 PM, Duncan Coutts > wrote: >> >> When we are done we intend to write up a blog post more details, e.g. >> numbers and the range/distribution of experience among candidates. I >> hope that will be useful to people who are in

Re: [Haskell-cafe] Monad transformers

2010-07-03 Thread Andrew Coppin
Roman Cheplyaka wrote: * Andrew Coppin [2010-07-03 14:20:14+0100] In my experience, using more than one monad transformer at once makes code utterly incomprehensible. See X monad (xmonad) for an counterexample. -- | The X monad, 'ReaderT' and 'StateT' transformers over 'IO' -- encaps

Re: [Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Andrew Coppin
Stephen Tetley wrote: On 3 July 2010 14:20, Andrew Coppin wrote: Tangentally, it seems to me that all monads can be described as doing zero or more of: - Invisibly pass state around (and possibly modify it). - Perform unusual flow control. - I/O (or some restricted subset of it). Can anybod

Re: [Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Andrew Coppin
Ivan Lazar Miljenovic wrote: Stephen Tetley writes: On 3 July 2010 14:20, Andrew Coppin wrote: Tangentally, it seems to me that all monads can be described as doing zero or more of: - Invisibly pass state around (and possibly modify it). - Perform unusual flow control. What

Re: [Haskell-cafe] Re: Rewriting a famous library and using the same name: pros and cons

2010-07-03 Thread Ivan Lazar Miljenovic
Stephen Tetley writes: > On 3 July 2010 14:00, Ivan Lazar Miljenovic wrote: > >> So this argument isn't valid ;-) > > I think it was Hugs compliant as least for some revisions - I seem to > remember looking at it before I switched to GHC. Actually, how would you call it in Hugs? Just start it

Re: [Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Claus Reinke
Most languages today provide a certain "glue" to bring everything together. Most languages today provide several kinds of glue and, while some of those kinds are not recommended, Haskell unfortunately doesn't provide all useful kinds of glue. Especially the module system is a weak point: in SML,

Re: [Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Ivan Lazar Miljenovic
Stephen Tetley writes: > On 3 July 2010 14:20, Andrew Coppin wrote: > >> Tangentally, it seems to me that all monads can be described as doing zero >> or more of: >> - Invisibly pass state around (and possibly modify it). >> - Perform unusual flow control. What do you consider "unusual"? -- I

Re: [Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Stephen Tetley
On 3 July 2010 14:20, Andrew Coppin wrote: > Tangentally, it seems to me that all monads can be described as doing zero > or more of: > - Invisibly pass state around (and possibly modify it). > - Perform unusual flow control. > - I/O (or some restricted subset of it). > Can anybody think of a mon

Re: [Haskell-cafe] Re: Rewriting a famous library and using the same name: pros and cons

2010-07-03 Thread Stephen Tetley
On 3 July 2010 14:18, Ivan Lazar Miljenovic wrote: > Stephen Tetley writes: > >> I think it was Hugs compliant as least for some revisions - I seem to >> remember looking at it before I switched to GHC. > > People still use Hugs? :p > > A bit more seriously: is there any listing anywhere of which

[Haskell-cafe] Monad transformers (was: Is my code too complicated?)

2010-07-03 Thread Roman Cheplyaka
* Andrew Coppin [2010-07-03 14:20:14+0100] > In my experience, using more than one monad transformer at once makes > code utterly incomprehensible. See X monad (xmonad) for an counterexample. -- | The X monad, 'ReaderT' and 'StateT' transformers over 'IO' -- encapsulating the window manager conf

Re: [Haskell-cafe] Re: Rewriting a famous library and using the same name: pros and cons

2010-07-03 Thread Miguel Mitrofanov
People still use Hugs? :p Is there another option for quick prototyping on iPhone? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Hugs Was: Rewriting a famous library and using the same name: pros and cons

2010-07-03 Thread Joachim Breitner
Hi, Am Samstag, den 03.07.2010, 23:18 +1000 schrieb Ivan Lazar Miljenovic: > Stephen Tetley writes: > > > I think it was Hugs compliant as least for some revisions - I seem to > > remember looking at it before I switched to GHC. > > People still use Hugs? :p > > A bit more seriously: is there

Re: [Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Andrew Coppin
Felipe Lessa wrote: Oh, so it is about monad transformers. =) I agree that it gets harder to reason about the code. In fact, sometimes I stack monad transformers in the wrong order. About monad transformers, I don't really like to use them because they can get hairy in some cases, and be

Re: [Haskell-cafe] Re: Rewriting a famous library and using the same name: pros and cons

2010-07-03 Thread Ivan Lazar Miljenovic
Stephen Tetley writes: > I think it was Hugs compliant as least for some revisions - I seem to > remember looking at it before I switched to GHC. People still use Hugs? :p A bit more seriously: is there any listing anywhere of which extensions Hugs supports? Definitely serious: if anything, I

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Ivan Lazar Miljenovic
Felipe Lessa writes: > There are many many other useful C libraries that we should have > bindings to. For example, Hackage doesn't have any MPI bindings. > Could we write an MPI client in Haskell? I guess so. Is it worth it? We might get some in two weeks time at AusHac!!! http://www.haskel

Re: [Haskell-cafe] Re: Rewriting a famous library and using the same name: pros and cons

2010-07-03 Thread Stephen Tetley
On 3 July 2010 14:00, Ivan Lazar Miljenovic wrote: > So this argument isn't valid ;-) Hi Ivan I think it was Hugs compliant as least for some revisions - I seem to remember looking at it before I switched to GHC. ___ Haskell-Cafe mailing list Haskell-

[Haskell-cafe] Re: Rewriting a famous library and using the same name: pros and cons

2010-07-03 Thread Ivan Lazar Miljenovic
Don Stewart writes: > > * Maintaining Haskell98 compatability. Keep it simple. (See >regex-posix's mistakes here) At the risk of resurrecting an old (albeit unfinished) thread, I've just discovered that FGL is actually not Haskell98 compatible anyway, as it utilised the following extensions:

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Felipe Lessa
On Sat, Jul 3, 2010 at 9:43 AM, Daniel Fischer wrote: > Andrew Coppin: >> > Who says they do, or should? >> >> Don, a few emails ago. > > I think you missed a small detail there. > >> ivan.miljenovic: >> > >> Hmm, interesting. Applicative and Traversable are two classes I've >> > >> never   used a

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Ivan Lazar Miljenovic
Daniel Fischer writes: >> > Knowing about something /= knowing how to use it.  I own and have read >> > RWH, but I've never had to use hsc2hs, or Applicative, etc. >> >> Writing libraries that bind to C is a great way to have to use a lot of >> hsc2hs (or c2hs), so clearly you need to contribute

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Daniel Fischer
On Saturday 03 July 2010 12:12:56, Thomas Davie wrote: > On 3 Jul 2010, at 11:04, Brandon S Allbery KF8NH wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > On 7/3/10 05:57 , Andrew Coppin wrote: > >> Agreed. So let me rephrase: Why should _every_ Haskell library > >> involve C? ;

Re: [Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Felipe Lessa
On Sat, Jul 3, 2010 at 9:25 AM, Ertugrul Soeylemez wrote: > Haskell provides a lot of low level glue like laziness, currying and > other very helpful language features.  But what is different in Haskell > is that it doesn't seem to provide any high level glue like other > languages do, especially

Re: [Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Bulat Ziganshin
Hello Ertugrul, Saturday, July 3, 2010, 4:25:22 PM, you wrote: > This has proven very useful for me. My usual way is writing monad > transformers and sticking them together, often together with concurrent > programming. > ... /what/ my code is > doing, because it's written in natural language a

Re: [Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Ivan Lazar Miljenovic
Ertugrul Soeylemez writes: [snip] > I fear that my code is already too difficult to understand for > beginners, and it's getting worse. But then I ask myself: I've got a > powerful language, so why shouldn't I use that power? After all I > haven't learnt Haskell to write C code with it. And

[Haskell-cafe] Is my code too complicated?

2010-07-03 Thread Ertugrul Soeylemez
Hello fellow Haskellers, I'd like to discuss an interesting topic. My experience is that there are two worlds in Haskell, which are quite separate: the pure, algorithmic world, where you use idiomatic pure Haskell, and the IO-driven world of state, change, threads and execution, where you use id

[Haskell-cafe] Re: Read Instance code.

2010-07-03 Thread Andy Stewart
Andy Stewart writes: > Ivan Lazar Miljenovic writes: > >> Andy Stewart writes: >> >>> Hi all, >>> >>> I have some incorrect "Read instance" make i got error "Prelude.read: no >>> parse", and i don't know how to fix it. >>> >>> >>> newtype SerializedWindow = SerializedWindow (Maybe DrawWindow)

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Ivan Lazar Miljenovic
Yves Parès writes: > And conversely, someone who have made a C-to-Haskell binding may not be a > Haskell guru. > > What about Arrows: do you think one should master them so that he could be > regarded as experienced? > It's kind of hard to put a border between casual Haskell and skilled > Haskell

Re[2]: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Bulat Ziganshin
Hello Ivan, Saturday, July 3, 2010, 3:24:34 PM, you wrote: >> haskell code is easily ported between OSes, unlike C one. when i >> ported my application from Win to Linux, i spend one day on haskell >> code and 3 days on C one, despite the fact that haskell code dealed >> with OS interaction and C

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Yves Parès
And conversely, someone who have made a C-to-Haskell binding may not be a Haskell guru. What about Arrows: do you think one should master them so that he could be regarded as experienced? It's kind of hard to put a border between casual Haskell and skilled Haskell, since it's a very wide language

[Haskell-cafe] Re: Read Instance code.

2010-07-03 Thread Andy Stewart
Ivan Lazar Miljenovic writes: > Andy Stewart writes: > >> Hi all, >> >> I have some incorrect "Read instance" make i got error "Prelude.read: no >> parse", and i don't know how to fix it. >> >> >> newtype SerializedWindow = SerializedWindow (Maybe DrawWindow) >> >> instance Show Serialized

Re: [Haskell-cafe] Read Instance code.

2010-07-03 Thread Ivan Lazar Miljenovic
Andy Stewart writes: > Hi all, > > I have some incorrect "Read instance" make i got error "Prelude.read: no > parse", and i don't know how to fix it. > > > newtype SerializedWindow = SerializedWindow (Maybe DrawWindow) > > instance Show SerializedWindow where > show _ = "SerializedWin

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Ivan Lazar Miljenovic
Mihai Maruseac writes: > As a matter of fact, all of my Haskell codes didn't even touch monads. > I always tried to write code as simple as possible and as > understandable as possible (mainly for teaching purposes) and not as > optimized as possible. I take it you don't use IO then? -- Ivan L

[Haskell-cafe] Read Instance code.

2010-07-03 Thread Andy Stewart
Hi all, I have some incorrect "Read instance" make i got error "Prelude.read: no parse", and i don't know how to fix it. --> code start <-- newtype SerializedWindow = SerializedWindow (Maybe DrawWindow) instance Show SerializedWindow w

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Ivan Lazar Miljenovic
Bulat Ziganshin writes: > haskell code is easily ported between OSes, unlike C one. when i > ported my application from Win to Linux, i spend one day on haskell > code and 3 days on C one, despite the fact that haskell code dealed > with OS interaction and C used purely for computations Care to

[Haskell-cafe] Spiking neural networks in Haskell

2010-07-03 Thread Dmitry V'yal
Greetings anyone, Some time ago I with a friend of mine implemented a toy interactive simulator of neural network activity. It has a totally imperative design and uses Gtk2hs for user interface parts. The darcs repository is available here: http://vyal.ru/code/spiking_neuro Now we decided to

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Joachim Breitner
Hi, Am Samstag, den 03.07.2010, 11:15 +0100 schrieb Andrew Coppin: > (That would suggest that Haskell is kind of a pointless exercise...) Haskell provides pointless exercises, but even these are not pointless. (SCNR) Joachim -- Joachim "nomeata" Breitner mail: m...@joachim-breitner.de | IC

[Haskell-cafe] Re: Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Andy Stewart
Brandon S Allbery KF8NH writes: > On 7/3/10 05:57 , Andrew Coppin wrote: >> Agreed. So let me rephrase: Why should _every_ Haskell library involve C? ;-) > > Who says they do, or should? AFAIK it's only done for the reasons I > mentioned (or, sometimes, for library compatibility; a native XCB li

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/3/10 06:12 , Thomas Davie wrote: > On 3 Jul 2010, at 11:04, Brandon S Allbery KF8NH wrote: >> Who says they do, or should? > > Dons rather implied it... The suggestion is that someone who hasn't used > hsc2hs is an inexperienced Haskeller... I'd

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Andrew Coppin
Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/3/10 05:57 , Andrew Coppin wrote: Agreed. So let me rephrase: Why should _every_ Haskell library involve C? ;-) Who says they do, or should? Don, a few emails ago. Personally, I agree with you - certa

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Thomas Davie
On 3 Jul 2010, at 11:04, Brandon S Allbery KF8NH wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 7/3/10 05:57 , Andrew Coppin wrote: >> Agreed. So let me rephrase: Why should _every_ Haskell library involve C? ;-) > > Who says they do, or should? Dons rather implied it... The s

Re[2]: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Bulat Ziganshin
Hello Andrew, Saturday, July 3, 2010, 1:57:22 PM, you wrote: > (I suppose I'm just bitter because any Haskell libraries involving C are > almost guaranteed to not work on Windows...) haskell code is easily ported between OSes, unlike C one. when i ported my application from Win to Linux, i spend

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/3/10 05:57 , Andrew Coppin wrote: > Agreed. So let me rephrase: Why should _every_ Haskell library involve C? ;-) Who says they do, or should? AFAIK it's only done for the reasons I mentioned (or, sometimes, for library compatibility; a native X

[Haskell-cafe] Re: Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Andy Stewart
Andrew Coppin writes: > Don Stewart wrote: > So I guess that means that I don't count as a "knowledgable" Haskell > programmer. :-( > RWH is free and online, and covers many useful things. There's no excuse :-) > > I was about to say "yeah, but RWH isn

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Andrew Coppin
Brandon S Allbery KF8NH wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/3/10 05:22 , Andrew Coppin wrote: Besides, why in the world do Haskell libraries have to involve C? I've written and released several libraries on Hackage, none of which are in any way related to C. Not every l

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/3/10 05:22 , Andrew Coppin wrote: > Besides, why in the world do Haskell libraries have to involve C? I've > written and released several libraries on Hackage, none of which are in any > way related to C. Not every library is just a C binding, you

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Mihai Maruseac
On Sat, Jul 3, 2010 at 12:30 PM, Chris BROWN wrote: >>> >> >> So hsc2hs is related to writing C bindings? Well, that'll be why I've >> never heard of it then; I don't understand C. (Nor do I particularly >> want to... I chose Haskell.) >> >> Besides, why in the world do Haskell libraries have to i

Re: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Chris BROWN
>> > > So hsc2hs is related to writing C bindings? Well, that'll be why I've > never heard of it then; I don't understand C. (Nor do I particularly > want to... I chose Haskell.) > > Besides, why in the world do Haskell libraries have to involve C? I've > written and released several librarie

[Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]

2010-07-03 Thread Andrew Coppin
Don Stewart wrote: So I guess that means that I don't count as a "knowledgable" Haskell programmer. :-( RWH is free and online, and covers many useful things. There's no excuse :-) I was about to say "yeah, but RWH isn't that good" - and then I noticed who I'm speaking to. ;-

Re: [Haskell-cafe] How easy is it to hire Haskell programmers

2010-07-03 Thread Thomas Davie
On 3 Jul 2010, at 03:39, Don Stewart wrote: > ivan.miljenovic: Hmm, interesting. Applicative and Traversable are two classes I've never used and don't really understand the purpose of. I have no idea what hsc2hs is. I keep hearing finger trees mentioned, but only in connection

Re: [Haskell-cafe] Parsec combinator like Prolog's cut operator?

2010-07-03 Thread S. Doaitse Swierstra
If you use the uu-parsing libraries you will get a breadth-first search, instead of a non-backtrcaking depth-first search of Parsec; furthermore you do not suffer from space leaks and get your results online. In addition you get error correction, with high-quality error messages. The principles

Re: [Haskell-cafe] Re: checking types with type families

2010-07-03 Thread Claus Reinke
Prelude> :t id :: Eq b => b -> b id :: Eq b => b -> b :: (Eq b) => b -> b Prelude> id :: Eq b => b -> b :1:0: No instance for (Show (b -> b)) arising from a use of `print' at :1:0-19 Possible fix: add an instance declaration for (Show (b -> b)) In a stmt of a 'do' expres

Re: [Haskell-cafe] a very pedestrian question about maillists

2010-07-03 Thread Roman Cheplyaka
* Vasili I. Galchin [2010-07-02 23:51:09-0500] > Hello, > > Suppose I have the following fragment of a posting: > > > Message: 3 > Date: Fri, 2 Jul 2010 12:32:43 -0500 > From: aditya siram > Subject: Re: [Haskell-cafe] How easy is it to hire Haskell programmers > To: Andrew Coppin > Cc:

Re: [Haskell-cafe] Status of status on freenode

2010-07-03 Thread Ketil Malde
Walt Rorie-Baety writes: > My work environment is what I'd call typical US corporate - IRC nodes are > blocked, but I can use a web-based client to access it. I solve these kinds of problems by routing stuff through an SSH connection to an outside server - which isn't blocked, but which could be

Re: [Haskell-cafe] checking types with type families

2010-07-03 Thread Kevin Quick
On Wed, 23 Jun 2010 00:14:03 -0700, Simon Peyton-Jones wrote: I'm interested in situations where you think fundeps work and type families don't. Reason: no one knows how to make fundeps work cleanly with local type constraints (such as GADTs). Simon, I have run into a case where fundeps+

Re: [Haskell-cafe] ANNOUNCE: hs-cryptohash 0.4

2010-07-03 Thread Vincent Hanquez
On Fri, Jul 02, 2010 at 11:01:17AM -0400, Brandon S Allbery KF8NH wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 7/2/10 07:23 , Vincent Hanquez wrote: > > I'm not sure exactly what the API would looks like, but I think basically > > you > > would enter/leave the state monad quite

Re: [Haskell-cafe] ANNOUNCE: hs-cryptohash 0.4

2010-07-03 Thread Vincent Hanquez
On 02/07/10 22:41, Gregory Crosswhite wrote: On 7/2/10 5:16 AM, Vincent Hanquez wrote: It's necessary in my case since i receive chunks of data to be hashed from the network, and I don't want to carry a buffer of data (with potential security issues), until i can hash everything. As an aside