Re: [Haskell-cafe] SIGPLAN Programming Languages Software Award

2011-06-08 Thread Yves Parès
many of the ideas of purely functional, typeful programming have been carried into newer languages and language features. including C#, F#, Java Generics, LINQ, Perl 6, Python, and Visual Basic 9.0. typeful programming and Python in the same sentence? ^^ More seriously, the influence of Haskell

Re: [Haskell-cafe] Cons of -XUndecidableInstances

2011-06-07 Thread Yves Parès
Personally, I came much less against UndecidableInstances when I was trying to do OOP in Haskell than when I was trying do Prolog-like things at the type level. Things like transitive relations: (If a type B contains an A, and if C contains B, then C contains A, and so on). I kind of abandonned

Re: [Haskell-cafe] Non-advanced usage of Type classes

2011-06-07 Thread Yves Parès
Is this badly designed code that tries to mimic OO in a functional setting? If the answer is yes, how could I achieve same result (eg. testing the code that does command REPL) without defining type classes? Why would that be badly designed? And why would that be more OO? IMO it is a perfectly

Re: [Haskell-cafe] Non-advanced usage of Type classes

2011-06-07 Thread Yves Parès
...and the other one being operational (which I find simpler). 2011/6/8 Brandon Allbery allber...@gmail.com On Tue, Jun 7, 2011 at 16:16, Arnaud Bailly arnaud.oq...@gmail.com wrote: For example, while designing some program (a game...) I defined a type class thus: class (Monad io) =

Re: [Haskell-cafe] lambda abstraction

2011-06-05 Thread Yves Parès
Well, yes add1 and add2 are equivalent. You can use either one or the other. The type annotation can be read: for all type 'a' such as 'a' is an instance of class Num, there exists a function add1 that takes an 'a' and returns an 'a'. 2011/6/5 Patrick Browne patrick.bro...@dit.ie Are the

Re: [Haskell-cafe] *GROUP HUG*

2011-06-04 Thread Yves Parès
Haskell at work. If anyone is curious, the project is essentially a service that determines the optimum order for a comparison shopping engine. On Thu, Jun 2, 2011 at 11:52 AM, Yves Parès limestr...@gmail.com wrote: Learning Haskell will pay off much less than learning PHP, if your goal

Re: [Haskell-cafe] Subcategories on Hackage

2011-06-04 Thread Yves Parès
Why not hierarchical tags? (Tags organized in directories, well, basically, tags with slashes or dots) This is the most flexible IMHO. 2011/6/4 Vo Minh Thu not...@gmail.com 2011/6/4 Tillmann Vogt tillmann.v...@rwth-aachen.de: Hi, There are some categories on Hackage that have become so

Re: [Haskell-cafe] Comment Syntax

2011-06-04 Thread Yves Parès
*Touché.* Nice one. 2011/6/4 Albert Y. C. Lai tre...@vex.net On 11-06-04 02:20 AM, Roman Cheplyaka wrote: It is, for my taste, a good comment marker, because of its resemblance to a dash. It makes the code look like real text: let y = x + 1 -- increment x COBOL is real text, if that

Re: [Haskell-cafe] Unbelievable parallel speedup

2011-06-03 Thread Yves Parès
I've enjoyed reading Simon Marlow's new tutorial on parallel and concurrent programming I am interested: where I this tutorial? 2011/6/3 John D. Ramsdell ramsde...@gmail.com I've enjoyed reading Simon Marlow's new tutorial on parallel and concurrent programming, and learned some surprisingly

Re: [Haskell-cafe] *GROUP HUG*

2011-06-02 Thread Yves Parès
Learning Haskell will pay off much less than learning PHP, if your goal is to find a job. Amen. I cannot agree with this for practical reasons. I'm using Haskell for real world commercial applications, and I'm very productive with it. I wish so much I could say that... Out of curiosity,

Re: [Haskell-cafe] What's the advantage of writing Haskell this way?

2011-05-31 Thread Yves Parès
Maybe you are looking for a more generic way to concatenate it: There is foldhttp://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-Foldable.html#v:fold:: (Foldable t, Monoid m) = t m - mhttp://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-Foldable.html#v:foldin

[Haskell-cafe] Thoughts about currying and optimisations

2011-05-31 Thread Yves Parès
Hello Café, An idea came to me: unless the compiler notices that stuffA and stuffB are equivalent, would it be correct to suppose that A is better than B? stuffA x = if someComputationallyExpensiveTest x then doSomething else doSomethingElse stuffB x y = if someComputationallyExpensiveTest x

Re: [Haskell-cafe] *GROUP HUG*

2011-05-31 Thread Yves Parès
come on! it's fun! i can write foldr with foldl! And when you try to explain that to your java-ITC-formatted friends, they utterly surprisingly seem not to care about it ^^ 2011/5/31 Adrien Haxaire adr...@adrienhaxaire.org Le 31/05/2011 21:15, Alberto G. Corona a écrit : Haskell is an

Re: [Haskell-cafe] Lazy Evaluation in Monads

2011-05-31 Thread Yves Parès
No, I think Artyom meant assuming IO is lazy. He intended to show that, indeed, it is not, or else side-effects would never be performed 2011/5/31 Scott Lawrence byt...@gmail.com On 05/31/2011 04:20 PM, Artyom Kazak wrote: Suppose iRecurse looks like this: iRecurse = do x -

Re: [Haskell-cafe] Thoughts about currying and optimisations

2011-05-31 Thread Yves Parès
It can introduce space leaks if the computationally expensive test is replaced with a reference to a space expensive value. You mean if the rest of stuffX's body keeps a reference to that value, I suppose? (I suppose, or else that value would be useless). Ok, so GHC does detect that case and

Re: [Haskell-cafe] State Machine and the Abstractions

2011-05-29 Thread Yves Parès
Yes, for my first example, the kind is wrong. I knew it, I just wrote it to show, not to be correct Haskell, sorry. @Antoine: Well, yes, internally, I think this is how it will be implemented. What I wondered was if arrows would provide a nice interface to it. @Stephen: Resumption monads? It

[Haskell-cafe] State Machine and the Abstractions

2011-05-27 Thread Yves Parès
Hello, For the purposes of a simple strategy game, I'd like to build an EDSL that expresses missions. A mission could be represented as a state machine. With basic bricks such as actions (MoveTo, ShootAt...) or tests (EnemiesAround, LowHealth...), I could (ideally dynamically) build some

Re: [Haskell-cafe] *GROUP HUG*

2011-05-25 Thread Yves Parès
So it seconds my initial point: you can't store the size because it has no sense. 2011/5/25 Ketil Malde ke...@malde.org Richard O'Keefe o...@cs.otago.ac.nz writes: Then tell me, why does calculating the length of a (Haskell) list has O(n) complexity. Because it is a rather rare

Re: [Haskell-cafe] *GROUP HUG*

2011-05-24 Thread Yves Parès
Why did you ask a question which you yourself characterize as ignorant? Juan, I think it is the kind of question whose answer is obvious to people with at least a little practice of the language. For instance, one of my friends asked me once why the operation of calculating the length of list

Re: [Haskell-cafe] *GROUP HUG*

2011-05-24 Thread Yves Parès
For Scala, I think it's really due to the type of people that are attracted to the community. My impression is that more people are coming from Java programming than from academia. Java developpers who whould be interested in doing things in a clean, expressive and manageable way? Maybe

Re: [Haskell-cafe] *GROUP HUG*

2011-05-24 Thread Yves Parès
pointed it out. 2011/5/24 Johannes Waldmann waldm...@imn.htwk-leipzig.de Yves Parès limestrael at gmail.com writes: For instance, one of my friends asked me once why the operation of calculating the length of list has an O(n) complexity, since to his opinion, you could just store the size

Re: [Haskell-cafe] *GROUP HUG*

2011-05-24 Thread Yves Parès
Will the same etiquette work when we start to get lots of questions from Java programmers? :) If you mean will we have to maintain the same etiquette? then, sadly, yes. (And I said we were done trolling! ;) ) 2011/5/24 Tom Murphy amin...@gmail.com Firstly, I would definitely like to second

Re: [Haskell-cafe] The Lisp Curse

2011-05-20 Thread Yves Parès
it can involve several qualified imports and time researching ByteStrings/Lazy ByteStrings/ByteString.Char8 Evan is right, the right way is to use the text package (plus, it is part of the platform and is simple to use), or at least the utf8-string package (encode/decode functions). I personnaly

Re: [Haskell-cafe] fishing for ST mutable Vector examples

2011-05-17 Thread Yves Parès
Hello all, By the way, is there any reason to prefer package 'vector' over package 'array'? Do they just provide different interfaces to similar functionnalities or are there real performance stakes? I personnaly prefer Data.Array, since: - It gives the possibility to index with something else

Re: [Haskell-cafe] ErrorT vs Either

2011-05-16 Thread Yves Parès
Probably because in the instance of Monad Either, fail has not been overloaded, and still has its default implementation: fail = error Whereas runErrorT explicitely catches the exception. 2011/5/16 Gracjan Polak gracjanpo...@gmail.com Hi all, A why question: Why: Control.Monad.Error

Re: [Haskell-cafe] Using cmake with haskell

2011-05-13 Thread Yves Parès
Talking about that, what are the differences between cabal-install and cabal-dev? Is cabal-dev (which I've never used nor installed) more suited for incremental development? 2011/5/12 Jason Dagit dag...@gmail.com On Wed, May 11, 2011 at 6:13 PM, Gregory Crosswhite

[Haskell-cafe] Stacking data types

2011-04-06 Thread Yves Parès
Hello Café, I'm trying to get some modular data types. The idea that came to me is that I could stack them, for instance : data Character a = Character { life :: Int, charaInner :: a } data Gun a = Gun { firepower :: Int, gunInner :: a } data

Re: [Haskell-cafe] Stacking data types

2011-04-06 Thread Yves Parès
I meant: chara = Character 100 $ Armor 40 $ Gun 12 *()* 2011/4/6 Yves Parès limestr...@gmail.com Hello Café, I'm trying to get some modular data types. The idea that came to me is that I could stack them, for instance : data Character a = Character { life :: Int

Re: [Haskell-cafe] Stacking data types

2011-04-06 Thread Yves Parès
(Gun b) a) = a - Gun b itsGun = content You were missing a mechanism to extract the inner value from your datatypes. - Job On Wed, Apr 6, 2011 at 2:57 PM, Yves Parès limestr...@gmail.com wrote: Hello Café, I'm trying to get some modular data types. The idea that came to me is that I

[Haskell-cafe] Multi agent system

2011-04-02 Thread Yves Parès
Hello, For the purpose of a simple game, I'm looking for a simple way to get agents communicating with each other, with agents possibly running on different threads: Basically, an agent is Agent :: * - *, since it is parameterized with the type of messages it can receive, and can make two basic

Re: [Haskell-cafe] Strictness is observable

2011-04-01 Thread Yves Parès
Then if you turn : fs True = True fs x = True to: fs x = case x of True - True x' - True Is it still strict, or does 'fs' wrap the case test and defer evaluation? 2011/4/1 o...@okmij.org Daniel Fischer wrote: If you have a strict function, you may evaluate its argument eagerly

Re: [Haskell-cafe] how to optmize this code?

2011-03-31 Thread Yves Parès
Just to be sure, because I am not quite familiar with the dark hairy internals of GHC: Of course, given a type signature that allows strictness to be inferred. You mean a signature with no type variables and types that are know to GHC as being strict? (Like Int - Int - Int instead of (Num a) =

Re: [Haskell-cafe] how to optmize this code?

2011-03-30 Thread Yves Parès
If I'm not wrong : sum [1..n] = (n² + n)/2 2011/3/30 Daniel Fischer daniel.is.fisc...@googlemail.com On Wednesday 30 March 2011 16:39:49, Gilberto Garcia wrote: Hi Haskellers, I was solving this problem from project euler to study haskell. I came up whit the following solution and I

[Haskell-cafe] Accessing to a Haskell type in C

2011-03-30 Thread Yves Parès
Hello, To access a haskell type from C code, do we have to make this type instance of Storable (and so to also define an homomorph structure on the C side), or does FFI specifies some C function to enable C code to access the fields, or even some GHC-specific functions? (Even if I'd prefer a

Re: [Haskell-cafe] object oriented technique

2011-03-29 Thread Yves Parès
Actually, Tako: data Shape = forall a. Drawable a = Shape a Can also be done with GADTs: data Shape where Shape :: Drawable a = a - Shape If wouldn't know if one approach is preferable to the other or if is just a matter of taste. Your problem, Tad, is kind of common. I ran

Re: [Haskell-cafe] object oriented technique

2011-03-29 Thread Yves Parès
contains Shape, your class Shapeful must provide all the necessary information (but that is kind of usual in Haskell). The advantage here is that you generalize the position (sx and sy fields) which are no longer duplicated within Rectange and Circle. 2011/3/29 Yves Parès limestr...@gmail.com Actually

Re: [Haskell-cafe] Looking for feedback on my attempt at a tree construction edsl

2011-03-22 Thread Yves Parès
You could turn 'insertSubTree' into and operator, and shorten insertLeaf createTree = do Fruits + do leaf Apple leaf Mango Arbitrary + do leaf 1 -- and so on... It's a little bit more concise. But I fail to see the use of TreeContext

Re: [Haskell-cafe] Data constructor synonyms

2011-03-18 Thread Yves Parès
You are better to use simple typeclasses. It depends on what you are trying to do, but when I want an open type, I use classes + type families. 2011/3/18 Stephen Tetley stephen.tet...@gmail.com On 18 March 2011 13:31, Grigory Sarnitskiy sargrig...@ya.ru wrote: Anyway, a new question arose.

Re: [Haskell-cafe] How large is the Haskell community ?

2011-03-17 Thread Yves Parès
http://steve-yegge.blogspot.com/2010/12/haskell-researchers-announce-discovery.htmlhttp://steve-yegge.blogspot.com/2010/12/haskell-researchers-announce-discovery.html I love the sentence We crafted a fake satirical post lampooning Haskell as an unusable, overly complex turd -- a writing task

Re: [Haskell-cafe] Subsets and supersets

2011-03-16 Thread Yves Parès
your subtype relation says A - B is a subtype of C -D whenever A is a supertype of C and B is a subtype of D, then checking subtyping is undecidable. In fashion terms: operator (-) is contravariant in its first argument and covariant in its second. ;) 2011/3/16 Brandon Moore

Re: [Haskell-cafe] ANN: Monad.Reader special Poetry and Fiction Edition

2011-03-16 Thread Yves Parès
Concerning this exercise, would it be simply possible to take the most of lazy evaluation and build a graph? A node would be: Node a = Node { data:: a, parents :: [Node a], children :: [Node a] } Then, whichever node you are on, you can still directly find its

[Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Yves Parès
Hello, A question recently popped into my mind: does lazy evaluation reduce the need to proper tail-recursion? I mean, for instance : fmap f [] = [] fmap f (x:xs) = f x : fmap f xs Here fmap is not tail-recursive, but thanks to the fact that operator (:) is lazy, I think that it may still run

Re: [Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Yves Parès
daniel.is.fisc...@googlemail.com On Wednesday 16 March 2011 18:31:00, Yves Parès wrote: Hello, A question recently popped into my mind: does lazy evaluation reduce the need to proper tail-recursion? I mean, for instance : fmap f [] = [] fmap f (x:xs) = f x : fmap f xs Here fmap

Re: [Haskell-cafe] Lazy evaluation and tail-recursion

2011-03-16 Thread Yves Parès
. Can a type signature give you a hint about whether a function evaluates some/all of its arguments (i.e. is strict/partially strict/lazy), or do you have to look at the implementation to know? 2011/3/16 Daniel Fischer daniel.is.fisc...@googlemail.com On Wednesday 16 March 2011 20:02:54, Yves

Re: [Haskell-cafe] Question on a common pattern

2011-03-14 Thread Yves Parès
If you have only one alternative, then you can simply do: Opt1 - someIO E.g., if you are _sure_ that foo returns always a 'Just' within a monad you can perfectly do : Just x - foo 2011/3/14 tsuraan tsur...@gmail.com In my code, I'm doing this quite a lot: x - someIO case x of Opt1 -

Re: [Haskell-cafe] Custom monad using ST

2011-03-10 Thread Yves Parès
init = mfix $ \ref - newIORef $ do writeIORef ref (return 0) return init 2011/3/10 Edward Kmett ekm...@gmail.com On Wed, Mar 9, 2011 at 6:21 PM, Yves Parès limestr...@gmail.com wrote: Well, I want to hide the fact that I'm using ST, so if I can hide the existential type 's

Re: [Haskell-cafe] ContT and ST stack

2011-03-10 Thread Yves Parès
Why has the operator (.) troubles with a type like (forall s. ST s a)? Why can't it match the type 'b' in (.) definition? 2011/3/10 Daniel Fischer daniel.is.fisc...@googlemail.com On Thursday 10 March 2011 14:18:24, Anakim Border wrote: Dear list, I have the following (simplified) piece

[Haskell-cafe] Custom monad using ST

2011-03-09 Thread Yves Parès
Hello, I am trying to make a monad that uses ST internally. But even when reducing this to the simplest case I'm still cramped by the 's' phantom type : {-# LANGUAGE Rank2Types #-} newtype MyST a = MyST (forall s. ST s a) -- ^ I cannot use deriving (Monad) through GeneralizedNewtypeDeriving

Re: [Haskell-cafe] Custom monad using ST

2011-03-09 Thread Yves Parès
Thanks! It works this way. I often forget the dangers of point-free notation... 2011/3/9 Jake McArthur jake.mcart...@gmail.com Try `return x = MyST (return x)`. It's (.) that throws it off. - Jake ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Custom monad using ST

2011-03-09 Thread Yves Parès
...@henning-thielemann.de On Wed, 9 Mar 2011, Yves Parès wrote: Hello, I am trying to make a monad that uses ST internally. But even when reducing this to the simplest case I'm still cramped by the 's' phantom type : {-# LANGUAGE Rank2Types #-} newtype MyST a = MyST (forall s. ST s a) -- ^ I

Re: [Haskell-cafe] ANNOUNCE: cinvoke 0.1 released

2011-03-06 Thread Yves Parès
It evokes me Python's ctypes module. Nice job ! I think It will be useful. 2011/3/6 Remi Turk rt...@science.uva.nl I am happy to finally announce cinvoke 0.1, a binding to the C library cinvoke[1], allowing functions to be loaded and called whose names and types are not known before

[Haskell-cafe] Use of uninstantiated type class

2011-03-04 Thread Yves Parès
Hello, For testing purposes, I am trying to make an overlay to IO which carries a phantom type to ensure a context. I define contexts using empty type classes : class CtxFoo c class CtxBar c The overlay : newtype MyIO c a = MyIO (IO a) Then I define some methods that run only a specific

Re: [Haskell-cafe] Use of uninstantiated type class

2011-03-04 Thread Yves Parès
On 5 March 2011 10:45, Yves Parès limestr...@gmail.com wrote: Hello, For testing purposes, I am trying to make an overlay to IO which carries a phantom type to ensure a context. I define contexts using empty type classes : class CtxFoo c class CtxBar c The overlay : newtype

Re: [Haskell-cafe] Use of uninstantiated type class

2011-03-04 Thread Yves Parès
Foo Foo = True type instance Ctx Bar Bar = True runFoo :: MyIO Foo a - IO a runBar :: MyIO Bar a - IO a fooCtxAction :: (Ctx Foo c) ~ True = MyIO c () bothCtxAction :: (Ctx Foo c `Or` Ctx Bar c) ~ True = MyIO c () allCtxAction :: MyIO c () 2011/3/5 Yves Parès limestr...@gmail.com But I don't

Re: [Haskell-cafe] Rank-2 types in classes

2011-03-03 Thread Yves Parès
Thanks for your proposal. It is not clear if the class constraint is really needed. Well 'IM' means 'ImplementationMonad', so it wouldn't make much sense if an IM of an implementation wasn't also a monad. And since IM is the central monad of the library, a lot of functions will use IM. The

[Haskell-cafe] Rank-2 types in classes

2011-03-02 Thread Yves Parès
Hello, I'm working on a library which aims to be a generic interface for 2D rendering. To do that, one of my goals is to enable each implementation of this interface to run in its own monad (most of the time an overlay to IO), thus giving me the following class class (Monad (IM i x)) = Impl i x

Re: [Haskell-cafe] Rank-2 types in classes

2011-03-02 Thread Yves Parès
Thank you ! Is what I'm trying to do a common technique to type-ensure contexts or are there simpler methods? 2011/3/2 Max Bolingbroke batterseapo...@hotmail.com On 2 March 2011 09:11, Yves Parès limestr...@gmail.com wrote: class (forall x. Monad (IM i x)) = Impl i where data IM i

Re: [Haskell-cafe] A practical Haskell puzzle

2011-03-02 Thread Yves Parès
Okay thanks I got the difference between both. The 'exists' syntax seems very useful. Is it planned to be added to GHC in a near future? 2011/2/28 Heinrich Apfelmus apfel...@quantentunnel.de Yves Parès wrote: takeC :: Int - Compoz a b - (exists c. Compoz a c) dropC :: Int - Compoz a b

Re: [Haskell-cafe] A practical Haskell puzzle

2011-02-28 Thread Yves Parès
takeC :: Int - Compoz a b - (exists c. Compoz a c) dropC :: Int - Compoz a b - (exists c. Compoz c b) What does 'exists' means? To create a rank-2 type can't you use: takeC :: Int - Compoz a b - (forall c. Compoz a c) ?? 2011/2/28 Heinrich Apfelmus apfel...@quantentunnel.de Yitzchak Gale

Re: [Haskell-cafe] Either instance of Monad?

2011-02-26 Thread Yves Parès
://hackage.haskell.org/packages/archive/base/4.3.0.0/doc/html/Control-Applicative.html 2011/2/24 Yves Parès limestr...@gmail.com I have the same problem with instances of Functor. For instance when I import Control.Applicative, to get the instance Functor ((-) a) I also have to import

Re: [Haskell-cafe] Either instance of Monad?

2011-02-26 Thread Yves Parès
I tried reinstalling GHC 7.0.1 from scratch, the issue remains... 2011/2/26 Daniel Fischer daniel.is.fisc...@googlemail.com On Saturday 26 February 2011 12:54:02, Yves Parès wrote: When I look at the documentation of Control.Monad.Error [1] or Control.Applicative [2] it is not said

Re: [Haskell-cafe] FFI: C-side object not destructed

2011-02-26 Thread Yves Parès
be that the same memory can be assigned to another object by new operator, but it doesn't get cleared or invalidated in any way. Seems to me, Haskell works in the same way. On 26 Feb 2011, at 13:59, Yves Parès wrote: Hello, I'm trying to use a C++ class in Haskell through C exports. It works

Re: [Haskell-cafe] Either instance of Monad?

2011-02-24 Thread Yves Parès
I have the same problem with instances of Functor. For instance when I import Control.Applicative, to get the instance Functor ((-) a) I also have to import Control.Monad.Instances. 2011/2/23 Daniel Fischer daniel.is.fisc...@googlemail.com: On Wednesday 23 February 2011 14:14:46, Yves Parès

Re: [Haskell-cafe] Either instance of Monad?

2011-02-23 Thread Yves Parès
I am using mtl-2. Importing Control.Monad.Error doesn't work, I have to explicitly import Control.Monad.Instances. 2011/2/22 Daniel Fischer daniel.is.fisc...@googlemail.com: On Tuesday 22 February 2011 23:07:05, Yves Parès wrote: Hello, When importing Control.Monad.Error, it shows me

Re: [Haskell-cafe] Either instance of Monad?

2011-02-23 Thread Yves Parès
The latest, I think : GHC 7.0.1, mtl-2.0.1.0, base-4.3.0.0 2011/2/23 Daniel Fischer daniel.is.fisc...@googlemail.com: On Wednesday 23 February 2011 09:58:56, Yves Parès wrote: I am using mtl-2. Importing Control.Monad.Error doesn't work, I have to explicitly import Control.Monad.Instances

Re: [Haskell-cafe] #haskell-game Haskellers Game Interest Group

2011-02-22 Thread Yves Parès
Concerning game development in Haskell, I would be most interested in an article explaining one (or several) game architectures in Haskell, i.e. how do you design the high layers of your game to take the most of Haskell features : threads, monads, type families etc. I don't know if such a paper

[Haskell-cafe] Either instance of Monad?

2011-02-22 Thread Yves Parès
Hello, When importing Control.Monad.Error, it shows me that (Either e) is an instance of MonadFix, but not an instance of Monad. Isn't there a problem? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] unicode filenames advice

2011-02-15 Thread Yves Parès
I noticed the same issue under ubuntu when feeding my program (i.e. on the command line) file names with special characters (my locale is fr_FR.UTF-8). I discovered I had to use Codec.Binary.String.UTF8.decodeString. I didn't know it was only for Unix. 2011/2/11 Joey Hess j...@kitenet.net I've

Re: [Haskell-cafe] Infinite lists in real world programs

2010-12-26 Thread Yves Parès
I had a similar experience under Windows. Never really got to find out why it happened. You might try adding a short threadDelay call in your main loop and see what happens; I think it helped back then. Wow... it's even worse. Even with a threadDelay of 1ms the FPS drop down to a chaotic 20~30. I

Re: [Haskell-cafe] Infinite lists in real world programs

2010-12-25 Thread Yves Parès
none of the examples use. But there isn't no known problem with Param? (Even if it's much more likely it comes from my code...) 2010/12/23 Yves Parès limestr...@gmail.com Thanks for your answers. In fact I tried to use Simple with a clock signal and it's painful to pass it wherever you need

Re: [Haskell-cafe] Infinite lists in real world programs

2010-12-23 Thread Yves Parès
Thanks for your answers. In fact I tried to use Simple with a clock signal and it's painful to pass it wherever you need it. Param is much more practical. I like Elerea, I tried Reactive and Yampa, and I found them (especially Yampa) heavy and not very practical. The fact that Elerea is

Re: [Haskell-cafe] Infinite lists in real world programs

2010-12-22 Thread Yves Parès
Patai, I read your paper on Elerea. It wasn't easy :), but I think I got the picture. So I would have 2 questions : I made a simple function which turns an infinite list into a signal : fromList :: [a] - SignalGen (Signal a) fromList xs = stateful xs tail = memo . fmap head 1) It does what I

Re: [Haskell-cafe] Infinite lists in real world programs

2010-12-18 Thread Yves Parès
/raw/master/docs/works09paper.pdf That describes a simple project that I think is similar to what you are looking at doing. The code is in that github repository as well, a couple directories up from the paper. https://github.com/mjsottile/hsworkflow/ -m On Dec 15, 2010, at 5:52 AM, Yves

Re: [Haskell-cafe] Infinite lists in real world programs

2010-12-16 Thread Yves Parès
Okay, I started to experiment things, and I came to some remarks: First, I cannot use bare lists, because of the way their Applicative instance is declared. I have to use the newtype ZipList (in Control.Applicative). So I have roughly this : import Control.Applicative newtype AgentSig a =

[Haskell-cafe] Infinite lists in real world programs

2010-12-15 Thread Yves Parès
Hello Café, I was wondering if using infinite lists was a viable and efficient solution in haskell programs (I mean not simple prototypes) : I was considering using them to model agents in a hierarchical multi-agent application for school. A list would representate the state of an agent at a step

Re: [Haskell-cafe] Infinite lists in real world programs

2010-12-15 Thread Yves Parès
-- tells it was too good too be true ^^. 2010/12/15 Brent Yorgey byor...@seas.upenn.edu On Wed, Dec 15, 2010 at 02:52:11PM +0100, Yves Parès wrote: Hello Café, So is it viable or would the use of multiple infinite lists kill the performances? Sounds perfectly reasonable to me. I don't

Re: [Haskell-cafe] Infinite lists in real world programs

2010-12-15 Thread Yves Parès
if one day you decide you need an agent that generates random numbers I could say that my agents now run in a certain monad, I just would have to transform my basic agents to : agent1 = liftM . fmap (*2) (or even agen1 = fmap . fmap (*2), however it is less readable IMO) Thanks for your

Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-10 Thread Yves Parès
I think this idea is a stairway to duck typing. I exagerate, of course, but here is my point: It shouldn't be difficult to make a class: class HasName a where name :: a - String The problem is when declaring Foo and Bar instances of HasName, since you have to copy code : data Foo = Foo String

Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-10 Thread Yves Parès
Brown nc...@kent.ac.uk On 10/11/10 12:36, Yves Parès wrote: I think this idea is a stairway to duck typing. I exagerate, of course, but here is my point: It shouldn't be difficult to make a class: class HasName a where name :: a - String For accessing parts of data structures that have

Re: [Haskell-cafe] Re: internship opportunities in France

2010-11-08 Thread Yves Parès
Yes, I saw this offer. Very, very interesting, but the duration of the internship wasn't specified. By summer, I thought you meant July/August, didn't you? But we are looking for a 6-month internship. 2010/11/8 Lee Pike leep...@gmail.com Hi, On a (possibly-related) note: Galois, Inc. and the

Re: [Haskell-cafe] internship opportunities in France

2010-11-06 Thread Yves Parès
Nope, the page is outdated. Gamr7 doesn't use Haskell currently. They used it before, but now Haskell is sort of in standby. Currently they mostly use Python and C/C++. I don't work here, I know it since I have applied for this intership proposal (I'm french too) and been accepted. 2010/11/6 Vo

Re: [Haskell-cafe] internship opportunities in France

2010-11-06 Thread Yves Parès
be some company or university in Europe that could offer such an intership. 2010/11/6 Yves Parès limestr...@gmail.com Nope, the page is outdated. Gamr7 doesn't use Haskell currently. They used it before, but now Haskell is sort of in standby. Currently they mostly use Python and C/C++. I don't

Re: [Haskell-cafe] Haskell is a scripting language inspired by Python.

2010-11-04 Thread Yves Parès
Nice. It is true that Python picked up some elements of Haskell, but now both languages are mature enough so that features can go both ways. It's called The *Ultimate* Computer Language Guide, and it's on the internets, so it must be correct, right? Wooow, it's barely 9 a.m. in France, it's

Re: [Haskell-cafe] What is simplest extension language to implement?

2010-11-04 Thread Yves Parès
There are other ways of adding Haskell as a scripting language - bundling ghc is not necessary. Even the program which is to run the scripts is compiled with GHC? I am interested to know how you do that. 2010/11/4 Malcolm Wallace malcolm.wall...@me.com ehm. I missed something and ghc api is

Re: [Haskell-cafe] Am I using type families well?

2010-11-02 Thread Yves Parès
I understand your point Ryan, but in that case, why didn't the error occur when Resource and ResourceId were separated classes? BTW, I assume for your Int instance of Resource, you meant: instance Resource Int where type IdOf *Int* = Int type LocOf *Int* = String type CfgOf *Int* = ()

Re: [Haskell-cafe] What is simplest extension language to implement?

2010-11-02 Thread Yves Parès
Or maybe Lua? There is already a Lua binding on Hackage. I've been advised to use it when I was also looking for a scripting language (and disadvised to use Scheme). 2010/11/2 Permjacov Evgeniy permea...@gmail.com Let us think, that we need some scripting language for our pure haskell project

Re: [Haskell-cafe] What is simplest extension language to implement?

2010-11-02 Thread Yves Parès
Because he would have either to recompile the whole program or to use things like hint, both implying that GHC must be installed on the user side (600Mo+ for GHC 6.12.3) 2010/11/2 Lennart Augustsson lenn...@augustsson.net I don't understand. Why don't you use Haskell as the scripting

Re: [Haskell-cafe] Am I using type families well?

2010-11-01 Thread Yves Parès
()) = eval rscs -- -- -- Other cases yet to come... greetings, Sjoerd On Nov 1, 2010, at 1:53 AM, Yves Parès wrote: Hello, I'm trying to make a simple monad (built on operational's ProgramT) for resource loading. I have classes featuring type families : {-# LANGUAGE

Re: [Haskell-cafe] Am I using type families well?

2010-11-01 Thread Yves Parès
not be injective In the second argument of `retrieveLoc', namely `id' In the expression: retrieveLoc cfg id In the definition of `loc': loc = retrieveLoc cfg id Seems like the compiler still has a 'rsc1' type despite the scoped type variable 'rsc'. 2010/11/1 Yves Parès limestr...@gmail.com

[Haskell-cafe] Am I using type families well?

2010-10-31 Thread Yves Parès
Hello, I'm trying to make a simple monad (built on operational's ProgramT) for resource loading. I have classes featuring type families : {-# LANGUAGE TypeFamilies, FlexibleContexts, GADTs #-} -- | A ResourceId is something that identifies a resource. -- It should be unique for one resource,

[Haskell-cafe] Perform a research a la Unix 'find'

2010-08-22 Thread Yves Parès
Hello, I would like to recode in Haskell a piece of bash program that uses find. The advantage of find is that it is quite easy to use and fast. Is there a package that let us access to find-like functionnalities, with similar performances? Or at least some C functions that could be used through

Re: [Haskell-cafe] Perform a research a la Unix 'find'

2010-08-22 Thread Yves Parès
Thanks, I will take a look at it. 2010/8/22 Erik Hesselink hessel...@gmail.com I've used the FileManip package for this. It works fine for my purposes. I have no idea what the performance is, though, beyond 'good enough not to care at the moment'. Erik On Sun, Aug 22, 2010 at 17:32, Yves

Re: [Haskell-cafe] Perform a research a la Unix 'find'

2010-08-22 Thread Yves Parès
Thanks for the HSH link, Magnus. Concerning FileManip, it seems that I can't perform easily a case-insensitive search (for instance with find, you just use -iname instead of -name). Am I wrong? 2010/8/22 Magnus Therning mag...@therning.org On 22/08/10 16:32, Yves Parès wrote: Hello, I

Re: [Haskell-cafe] Perform a research a la Unix 'find'

2010-08-22 Thread Yves Parès
: run $ find fooé it says : find: foo*\351*: No file or directory So it is not the same encoding! 2010/8/22 Yves Parès limestr...@gmail.com Thanks for the HSH link, Magnus. Concerning FileManip, it seems that I can't perform easily a case-insensitive search (for instance with find, you just

[Haskell-cafe] Filename encoding error (was: Perform a research a la Unix 'find')

2010-08-22 Thread Yves Parès
) -- Forwarded message -- From: Yves Parès limestr...@gmail.com Date: 2010/8/22 Subject: Re: [Haskell-cafe] Perform a research a la Unix 'find' To: Magnus Therning mag...@therning.org Cc: haskell-cafe@haskell.org I looked at both, and I have encoding issues with both. My locale

Re: [Haskell-cafe] Embedded scripting Language for haskell app

2010-08-18 Thread Yves Parès
Mmh, I raised this question some months ago, I thought about Scheme and I've been recommended to use Lua instead of Scheme (as far as I remember, the author of a scheme implementation available on Hackage told it wasn't solid enough). I would add something: who will script for your application?

Re: [Haskell-cafe] Is 'flip' really necessary?

2010-07-27 Thread Yves Parès
(??) is misleading, some may be tempted to write things like: func ?? 45 ?? x , forgetting that ?? is just a mere operator, not a syntactic convenience. Unfortunately, Haskell doesn't provide Scala's underscore for partially applied functions: func(56, _, foo, _)

Re: [Haskell-cafe] Actors and message-passing a la Erlang

2010-07-27 Thread Yves Parès
I've found that I like Erlang's pattern matching for sorting through different kinds of data payloads, but that I prefer to use typed data channels per Limbo, Go, Plan 9's thread and messaging libraries etc. I've often wanted an Erlang with static typing to get this capability. Actually you are

Re: [Haskell-cafe] Actors and message-passing a la Erlang

2010-07-26 Thread Yves Parès
In fact, I noticed Holumbus. You say that With the help of this library it is possible to build Erlang-Style mailboxes, but how would you solve the issue of static typing? Besides, Holumbus depends on package 'unix', preventing it from being used on non-unix platforms. 2010/7/26 Stefan Schmidt

[Haskell-cafe] Actors and message-passing a la Erlang

2010-07-25 Thread Yves Parès
Hello ! I've been studying Erlang and Scala, and I was wondering if someone has already implemented an actors and message passing framework for concurrent and distributed programs in Haskell. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

<    1   2   3   4   >