[Haskell-cafe] Read instance for GATD

2010-06-25 Thread corentin . dupont
Hello Haskellers, I'm having trouble writing a Read Instance for my GATD. Arg this GATD!! It causes me more problems that it solves ;) Especially with no automatic deriving, it adds a lot of burden to my code. data Obs a where ProposedBy :: Obs Int -- The player that proposed the

[Haskell-cafe] GHCi and State

2010-06-25 Thread corentin . dupont
Another couple of reflexions (sorry for monopolizing): 1. Since i am making a Nomic game, players will have to submit rules. These rules will be written in a sub-set of haskell. Instead of writing my own reader/interpreter, i'd like to use GHC to compil them on the fly, and then add them to the

Réf. : Re: [Haskell-cafe] GHCi and State

2010-06-25 Thread corentin . dupont
Hello, thank you for your answer. Brandon, Indeed I think that i should write my own interpreter for a first version of the game. I would be very instructive. But then, i'd like that the player could use the full power of Haskell to write their own rules during game play. Neat functions like

Re: [Haskell-cafe] circular imports

2010-09-07 Thread corentin . dupont
Hello, I had recently a really hard time splitting up my program into parts! The natural, business-oriented split up drove me into a deadly circular dependency. I tried to solve it with: - .hs-boot: It adds a lot of duplicated code and unecessary files, so I gave up - type variables: that too

Réf. : [Haskell-cafe] Re: circular imports

2010-09-07 Thread corentin . dupont
That sort of code (stripped out): In Game.hs: data Game = Game { ... activeRules :: [Rule]} applyTo :: Rule - Game - Game applyTo r gs = ... In Rule.hs: data Rule = Cond (Obs) Rule Rule | many others.. deriving (Read, Show, Eq, Typeable) data NamedRule

Re: [Haskell-cafe] internship opportunities in France

2010-11-06 Thread Corentin Dupont
Hello, as well as I know, there is very few, if no, jobs in Haskell in France. They are much more on CAML. Corentin On Sat, Nov 6, 2010 at 9:00 PM, Lorenzo Fundaró lfund...@etu.utc.fr wrote: Hello folks ! I am a Computer Science student looking for an internship of 6 months here in France.

Re: [Haskell-cafe] How can I use MACID in my existing application?

2010-11-07 Thread Corentin Dupont
Hello Jeremy, thanks for your mail. I am in despair on this problem since days, I would really help your help. I can't figure out how I can add MACID into my program. Here's the problem: I already have monads in my program like that: type Comm = StateT Communication IO type GameState a =

Re: [Haskell-cafe] How can I use MACID in my existing application?

2010-11-08 Thread Corentin Dupont
not answered your question, or you have others, feel free to ask! - jeremy On Nov 7, 2010, at 10:02 AM, Corentin Dupont wrote: Hello Jeremy, thanks for your mail. I am in despair on this problem since days, I would really help your help. I can't figure out how I can add MACID into my

[Haskell-cafe] web-routes and forms

2011-01-08 Thread Corentin Dupont
jer...@n-heptane.com wrote: Hello, The [(String, String)] argument is for adding query parameters. encodePathInfo [foo, bar, baz] [(key,value)] foo/bar/baz?key=value Instead of showURL you would use showURLParams. hope this helps!d - jeremy On Fri, Jan 7, 2011 at 8:12 AM, Corentin

Re: [Haskell-cafe] web-routes and forms

2011-01-09 Thread Corentin Dupont
. - jeremy On Sat, Jan 8, 2011 at 6:44 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hello, I have difficulties mixing web-routes and forms: I have put routes in all my site, except for forms which remains with the type ServerPartT IO Response. How to make them work together? I

Re: [Haskell-cafe] web-routes and forms

2011-01-13 Thread Corentin Dupont
if you have more questions. - jeremy On Sat, Jan 8, 2011 at 6:44 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hello, I have difficulties mixing web-routes and forms: I have put routes in all my site, except for forms which remains with the type ServerPartT IO Response. How

[Haskell-cafe] Happstack events and web page refreshing

2011-01-17 Thread Corentin Dupont
the question is 2 fold: - How to add an event handler on happstack-state for that? - How to ask to the web server to refresh every clients? I did not found infos about that in the API. Thanks a lot, Corentin On Thu, Jan 13, 2011 at 9:40 PM, Corentin Dupont corentin.dup...@gmail.comwrote: Hello

Re: [Haskell-cafe] Happstack events and web page refreshing

2011-01-17 Thread Corentin Dupont
to get the data to the client, then you can figure out how to track changes to the MACID database. - jeremy On Jan 17, 2011, at 4:58 AM, Corentin Dupont wrote: Hello again, I have another question for happstack users/experts: I have a program with happstack-state and a web server

Re: [Haskell-cafe] Happstack events and web page refreshing

2011-01-17 Thread Corentin Dupont
...@gmail.com wrote: On Mon, 2011-01-17 at 18:25 +0100, Corentin Dupont wrote: Thanks a lot for your response Jeremy. I can see a lot of site that does update infos without the user to have to click refresh (I think Facebook does?). Do they do polling? While I'm not familiar with Facebook, I'd

Re: [Haskell-cafe] Happstack events and web page refreshing

2011-01-19 Thread Corentin Dupont
: On 17 January 2011 21:50, Jeremy Shaw jer...@n-heptane.com wrote: On Jan 17, 2011, at 2:19 PM, Corentin Dupont wrote: Indeed, I tried with META HTTP-EQUIV=Refresh CONTENT=n ? and it's unusable. It make blink the page, ungrey the stop button for a second and make the fields loose

Re: [Haskell-cafe] web-routes and forms

2011-01-19 Thread Corentin Dupont
version. - jeremy On Thu, Jan 13, 2011 at 2:40 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hello, I'm using the combination happstack + digestive-functors + web-routes + blazeHTML. I'm not finding any examples on the net... I've tried to adapt your example (thanks): type

Re: [Haskell-cafe] web-routes and forms

2011-01-21 Thread Corentin Dupont
): https://github.com/cdupont/Nomic Thanks, Corentin On Wed, Jan 19, 2011 at 5:12 PM, Corentin Dupont corentin.dup...@gmail.comwrote: Thanks Jeremy. I had it to work now ;) Corentin On Tue, Jan 18, 2011 at 6:01 PM, Jeremy Shaw jer...@n-heptane.com wrote: Hello, trhsx will be installed

Re: [Haskell-cafe] web-routes and forms

2011-01-22 Thread Corentin Dupont
in web-routes that needs to be addressed ? - jeremy On Fri, Jan 21, 2011 at 2:33 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hello Jeremy, I'm still trying to integrate web routes, but there is one thing I don't understand: how to deal with multiple forms? In my former

Re: [Haskell-cafe] Fwd: web-routes and forms

2011-01-28 Thread Corentin Dupont
Hello again, is there a way to had a hidden field in digestive-functor-blaze? I'm using it to transmit some data... Thanks, Corentin On Thu, Jan 27, 2011 at 11:21 AM, Corentin Dupont corentin.dup...@gmail.com wrote: OK thanks, now it's clear! On Thu, Jan 27, 2011 at 11:13 AM, Jasper Van der

Re: [Haskell-cafe] Fwd: web-routes and forms

2011-01-29 Thread Corentin Dupont
:10 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hello again, is there a way to had a hidden field in digestive-functor-blaze? I'm using it to transmit some data... Thanks, Corentin On Thu, Jan 27, 2011 at 11:21 AM, Corentin Dupont corentin.dup...@gmail.com wrote: OK

[Haskell-cafe] mapping a concept to a type

2012-05-18 Thread Corentin Dupont
Hi everybody, I'm still working on implementing a nomic game in Haskell. Although the game is pretty advanced, I'm still confused by one fundamental question: A nomic game is composed of rules. A Rule is a sort of little program submitted by the player during the game. They come in two fashions: -

Re: [Haskell-cafe] mapping a concept to a type

2012-05-18 Thread Corentin Dupont
Yes I totally agree, they have different kind. A Normal Rule is * whereas a Meta Rule is * - *. But I have no experience with typeclasses. That could be what I'm looking for! What they have in common? Well, Id' say that a rule (whatever sort it is) can: - change the state of the game when executed

Re: [Haskell-cafe] mapping a concept to a type

2012-06-04 Thread Corentin Dupont
on event). This make handling them much more complex!! I'm wondering what middle way I can choose. Corentin On Sat, May 19, 2012 at 1:06 AM, Corentin Dupont corentin.dup...@gmail.com wrote: Yes I totally agree, they have different kind. A Normal Rule is * whereas a Meta Rule is * - *. But I

Re: [Haskell-cafe] mapping a concept to a type

2012-06-04 Thread Corentin Dupont
handling them much more complex!! I'm wondering what middle way I can choose. Corentin On Sat, May 19, 2012 at 1:06 AM, Corentin Dupont corentin.dup...@gmail.com wrote: Yes I totally agree, they have different kind. A Normal Rule is * whereas a Meta Rule is * - *. But I have no experience

[Haskell-cafe] event handler

2012-06-14 Thread Corentin Dupont
Hi folks, I'm trying to make a simple event driven engine. It simply consists of two functions: - addEvent, where you pass the event name with a callback, - triggerEvent where you pass the event name with the data. the data shall be passed to the callback of the corresponding event. I have

Re: [Haskell-cafe] event handler

2012-06-14 Thread Corentin Dupont
On Thu, Jun 14, 2012 at 10:05 PM, Alexander Solla alex.so...@gmail.comwrote: On Thu, Jun 14, 2012 at 12:15 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hi folks, I'm trying to make a simple event driven engine. It simply consists of two functions: - addEvent, where you pass

Re: [Haskell-cafe] event handler

2012-06-15 Thread Corentin Dupont
Rule) (R 2) eventList2 --yelds New Rule* 2 Best, Corentin On Fri, Jun 15, 2012 at 12:40 AM, Alexander Solla alex.so...@gmail.comwrote: On Thu, Jun 14, 2012 at 2:04 PM, Corentin Dupont corentin.dup...@gmail.com wrote: That look really nice! Unfortunately I need to have an heterogeneous

Re: [Haskell-cafe] event handler

2012-06-15 Thread Corentin Dupont
...@gmail.comwrote: On Fri, Jun 15, 2012 at 6:38 AM, Corentin Dupont corentin.dup...@gmail.com wrote: It just bothers me a little that I'm not able to enumerate the events, and also that the user is able to create events with wrong types (like New :: Event String), even if they won't be able

Re: [Haskell-cafe] event handler

2012-06-16 Thread Corentin Dupont
Just wondering, could type families be of any help here? I don't know type families, but can it be a mean to regroup together the event types, that are now completely separated : *data NewPlayer deriving Typeable data NewRule deriving Typeable* On Fri, Jun 15, 2012 at 10:59 PM, Corentin Dupont

Re: [Haskell-cafe] event handler

2012-06-16 Thread Corentin Dupont
15, 2012 at 1:59 PM, Corentin Dupont corentin.dup...@gmail.com wrote: I made some modifications based on your suggestions (see below). I made a two parameters class: *class (Typeable e, Typeable d) = Handled e d * Because after all what I want is to associate an event with its type

Re: [Haskell-cafe] event handler

2012-06-17 Thread Corentin Dupont
--Yelds New Rule 2 * Thanks again!! Corentin On Sun, Jun 17, 2012 at 12:46 AM, Alexander Solla alex.so...@gmail.comwrote: On Sat, Jun 16, 2012 at 3:31 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hi Alexander, sorry my initial example was maybe misleading. What I really what to do

Re: [Haskell-cafe] existential types and cast

2012-07-05 Thread Corentin Dupont
avoid using type indexing at all, because it doesn't resolve the handler selection issue. By the way , it's not clear to me why you don't have a simple Event datatype describing all the possible events in advance. Regards paolino 2012/7/3 Corentin Dupont corentin.dup...@gmail.com Hi all

Re: [Haskell-cafe] existential types and cast

2012-07-05 Thread Corentin Dupont
= mapM_ (handle p) es return es reaction r@(NewRule _) es = mapM_ (handle r) es return es 2012/7/4 Corentin Dupont corentin.dup...@gmail.com Hi, for example, in my game (Nomic) if a new player arrives, I trigger a NewPlayer event. All handlers registered for that event should be triggered

Re: [Haskell-cafe] existential types and cast

2012-07-05 Thread Corentin Dupont
seems wrong. paolino 2012/7/4 Corentin Dupont corentin.dup...@gmail.com Hi Paolino, the user can add as many handlers he wants for each event. When a event is triggered along with a data, all handlers associated to that event should be triggered and passed the data. The trick

[Haskell-cafe] every Friday the 13th at midnight...

2012-07-27 Thread Corentin Dupont
Hello! I'm looking for a library to be able to express, store and retrieve recurring appointments, like every Monday at midnight. I saw Data.Time.Recurrence, which has a nice language, but how to store the appointments? A command like: *now - getCurrentTime recur daily `begin` now* produces an

Re: [Haskell-cafe] every Friday the 13th at midnight...

2012-07-27 Thread Corentin Dupont
. Is there a high-level scheduler in the libraries? For example I would pass it a list of UTCTimes and it wakes me up for my next appointment :) Best, Corentin On Fri, Jul 27, 2012 at 5:14 PM, Brandon Allbery allber...@gmail.comwrote: On Fri, Jul 27, 2012 at 5:50 AM, Corentin Dupont

[Haskell-cafe] happstack simpleHTTP state monad

2012-08-30 Thread Corentin Dupont
Hi all, I'm trying to make a web server that manages its own state. The user can issue commands that modifies the state. I did like below but unfortunatly the state is not keep after a command is issued... What is the right way to do it? Is there any example sites with an internal state with

Re: [Haskell-cafe] happstack simpleHTTP state monad

2012-08-30 Thread Corentin Dupont
. Regards, Erik On Thu, Aug 30, 2012 at 7:29 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hi all, I'm trying to make a web server that manages its own state. The user can issue commands that modifies the state. I did like below but unfortunatly the state is not keep after a command

[Haskell-cafe] type variable in class instance

2012-09-10 Thread Corentin Dupont
Hello everybody! I'm soliciting once again your help! It's been several days I'm blocked by this problem: *{-# LANGUAGE DeriveDataTypeable #-} import Data.Typeable class (Typeable e) = Event e data Player = Player Intderiving (Typeable) data Message m = Message

Re: [Haskell-cafe] type variable in class instance

2012-09-10 Thread Corentin Dupont
Hi Stephen, I wasn't aware of Data.Dynamic. I tried: *viewEvent :: Dynamic - IO () viewEvent event = do case fromDynamic event of Nothing - return () Just (Message s) - putStrLn $ show s* But still got the same error (Ambiguous type variable `t0' in the constraint: (Typeable

Re: [Haskell-cafe] type variable in class instance

2012-09-11 Thread Corentin Dupont
Thanks Martijn, Oleg and Ryan for your kind replies! @Ryan and Martijn: I considered putting the viewEvent in the typeclass, but I figured out that would break the separation of concerns. Indeed this typeclass Event belongs to the inner engine, while the display is done in another component (not

Re: [Haskell-cafe] type variable in class instance

2012-09-11 Thread Corentin Dupont
Yes. That's fantastic! This GADT is the missing piece of my puzzle. I transformed a bit your solution, polluting it with some classes instances and fleshing the functions: *data Player = Arrive | Leave deriving (Show, Typeable, Eq) data Message m = Message String deriving (Show, Typeable, Eq)

Re: [Haskell-cafe] type variable in class instance

2012-09-11 Thread Corentin Dupont
) [] msg :: Message Int msg = Message give me a number myList = addEvent (MessageEvent msg) (\(MessageData n) - putStrLn $ Your number is: ++ show n) [] trigger = triggerEvent (MessageEvent msg) (MessageData 1) myList --Yelds Your number is: 1* On Tue, Sep 11, 2012 at 5:06 PM, Corentin Dupont

Re: [Haskell-cafe] type variable in class instance

2012-09-11 Thread Corentin Dupont
not sure I understand On Tue, Sep 11, 2012 at 11:06 AM, Corentin Dupont corentin.dup...@gmail.com wrote: Yes. That's fantastic! This GADT is the missing piece of my puzzle. I transformed a bit your solution, polluting it with some classes instances and fleshing the functions: data Player

Re: [Haskell-cafe] type variable in class instance

2012-09-11 Thread Corentin Dupont
the event type. On Tue, Sep 11, 2012 at 7:03 PM, Corentin Dupont wrote: unfortunately it seems that I will be obliged to maintain 2 parallel structures: for each Event instance, I will have to add a ViewEvent element as well carrying the same information: That's why I like the all-GADT

Re: [Haskell-cafe] type variable in class instance

2012-09-12 Thread Corentin Dupont
If I understand, the SomeEvent event acts as a proxy to hide the diversity of the events? That's interesting. This way I don't have to use an heterogeneous list and a lot of casting... On Wed, Sep 12, 2012 at 7:44 AM, o...@okmij.org wrote: Let me see if I understand. You have events of

Re: [Haskell-cafe] Tutorial: Haskell for the Evil Genius

2012-09-14 Thread Corentin Dupont
Well, to make it short, I liked it! As suggestions, little things like first class functions and partial application can be easily introduced. For example the line: map (+1) [1..10] contains these concepts and it very short and expressive. On the story side, why not introducing a character? This

[Haskell-cafe] serialize an unknown type

2012-10-20 Thread Corentin Dupont
Hi the list! I have a simple question, how can I serialize/deserialize a structure like this: data InputChoice c deriving Typeable data Event a where InputChoice :: (Eq c, Show c) = [c] - c - Event (InputChoice c) (...) I'd like that the values of type c get serialized to a String...

Re: [Haskell-cafe] serialize an unknown type

2012-10-21 Thread Corentin Dupont
Nobody on this one? Here is a simplified version: data Event a where InputChoice :: a - Event a How to serialize/deserialize this? Cheers, Corentin On Sat, Oct 20, 2012 at 10:49 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hi the list! I have a simple question, how can I

Re: [Haskell-cafe] serialize an unknown type

2012-10-21 Thread Corentin Dupont
at 7:03 PM, MigMit miguelim...@yandex.ru wrote: Seems like nobody really understands what is it that you want to accomplish or what your problem is. Отправлено с iPhone 21.10.2012, в 20:39, Corentin Dupont corentin.dup...@gmail.com написал(а): Nobody on this one? Here is a simplified version

Re: [Haskell-cafe] serialize an unknown type

2012-10-21 Thread Corentin Dupont
, Corentin Dupont wrote: Hi, Sorry if it was not enough explicit. I want to write functions like this: serialize :: (Show a) = Event a - IO () deserialize :: (Read a) = IO () - Event a The functions would write and read the data in a file, storing/retrieving also the type a I

Re: [Haskell-cafe] serialize an unknown type

2012-10-21 Thread Corentin Dupont
, Typeable, Show, Eq, Bounded) So, the list of types is not known in advance. I could ask my user to make his new type an instance of a class as suggested by Alberto... On Oct 21, 2012, at 9:20 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hi, Sorry if it was not enough explicit. I

Re: [Haskell-cafe] serialize an unknown type

2012-10-24 Thread Corentin Dupont
...@gmail.com wrote: Corentin Dupont corentin.dup...@gmail.com wrote: I could ask my user to make his new type an instance of a class as suggested by Alberto... If you are working with unknown types, then your options are: (a) constrain to some type class, or (b) have your clients pass in functions

Re: [Haskell-cafe] serialize an unknown type

2012-10-25 Thread Corentin Dupont
Hi, I designed my event engine like this: -- | events types data Player = Arrive | Leave deriving (Typeable, Show, Eq) data RuleEvent = Proposed | Activated | Rejected | Added | Modified | Deleted deriving (Typeable, Show, Eq) data Time deriving Typeable data InputChoice c deriving

[Haskell-cafe] schedule function

2012-12-06 Thread Corentin Dupont
Hi all, I have a simple question: is there in the libraries a function that can schedule a variable list of events for me? For example of the type: type Schedule = [UTCTime, IO()] startSchedule :: TVar Schedule - IO ThreadId The function startSchedule will have to execute my actions at the given

[Haskell-cafe] multi-thread and lazy evaluation

2012-12-24 Thread Corentin Dupont
Hi all, I have a program where the user can submit his own little programs, which are interpreted using Hint. The user-submitted programs are used to modify a state held in a TVar. As of course those user-submitted programs can't be trusted, I'm trying to protect them, like in Mueval. I installed

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-24 Thread Corentin Dupont
:17 PM, Corentin Dupont corentin.dup...@gmail.comwrote: Hi all, I have a program where the user can submit his own little programs, which are interpreted using Hint. The user-submitted programs are used to modify a state held in a TVar. As of course those user-submitted programs can't be trusted

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-25 Thread Corentin Dupont
must be done in another thread... Best, Corentin On Mon, Dec 24, 2012 at 3:46 PM, Brandon Allbery allber...@gmail.comwrote: On Mon, Dec 24, 2012 at 8:45 AM, Corentin Dupont corentin.dup...@gmail.com wrote: *execBlocking :: MVar (Maybe MyData) - IO () execBlocking mv = do let (a::String

Re: [Haskell-cafe] multi-thread and lazy evaluation

2012-12-25 Thread Corentin Dupont
Great, with me compiled with ghc -threaded the bug shows up. However, runnning main in ghci doesn't show the bug (it finishes correctly). I have GHC 7.4.1. Corentin On Tue, Dec 25, 2012 at 3:34 PM, timothyho...@seznam.cz wrote: This seems like a bug in GHC. But it has nothing to do with MVars.

[Haskell-cafe] Error: junk while building GHC

2013-02-11 Thread Corentin Dupont
Hi all, I'm trying to build GHC HEAD snapshot 7.7.20130210, I have the following error: inplace/bin/ghc-stage1 -optc-Ilibraries/ghc-prim/. -optc-I'/home/cdupont/Haskell/ghc-7.7.20130210/rts/dist/build' -optc-I'/home/cdupont/Haskell/ghc-7.7.20130210/includes'

[Haskell-cafe] Type checking the content of a string

2013-02-22 Thread Corentin Dupont
Hi all, I have a program able to read another program as a string, and interpret it (using Hint). I'd like to make unit tests, so I have a file Test.hs containing a serie of test programs as strings. However, how could I be sure that these test program are syntactically valid, at compile time?

Re: [Haskell-cafe] Type checking the content of a string

2013-02-22 Thread Corentin Dupont
Hi Adam, that looks interresting. I'm totally new to TH and QuasiQuotes, though. Can I run IO in a QuasiQuoter? I can run my own interpreter. On Fri, Feb 22, 2013 at 7:12 PM, adam vogt vogt.a...@gmail.com wrote: On Fri, Feb 22, 2013 at 12:44 PM, Corentin Dupont corentin.dup...@gmail.com

Re: [Haskell-cafe] Type checking the content of a string

2013-02-22 Thread Corentin Dupont
Feb 2013 19:43:51 +0100, Corentin Dupont wrote: Hi Adam, that looks interresting. I'm totally new to TH and QuasiQuotes, though. Can I run IO in a QuasiQuoter? I can run my own interpreter. Yes, you can: http://hackage.haskell.org/packages/archive/template-haskell/2.8.0.0/doc/html

Re: [Haskell-cafe] Type checking the content of a string

2013-02-22 Thread Corentin Dupont
:51 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Great! That seems very powerful. So you can do what you want during compilation, readin files, send data over the network? Other question, in my example how can I halt the compilation if a test program is wrong? On Fri, Feb 22, 2013

Re: [Haskell-cafe] Type checking the content of a string

2013-02-23 Thread Corentin Dupont
Up on that, anybody already tried to load an haskell interpreter in a QuasiQuoter? On Sat, Feb 23, 2013 at 12:03 AM, Corentin Dupont corentin.dup...@gmail.com wrote: I'm trying to load my interpreter in the Q monad: cr :: QuasiQuoter cr = QuasiQuoter { quoteExp = quoteRuleFunc

Re: [Haskell-cafe] Type checking the content of a string

2013-02-23 Thread Corentin Dupont
understand, trying to combine hint and TH would be redundant (even if it worked): whatever String you can evaluate using hint, you can evaluate it directly in TH. Is this not the case? Cheers, Daniel On Feb 23, 2013, at 6:53 PM, Corentin Dupont wrote: Hi Daniel, Did you already tried

[Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-26 Thread Corentin Dupont
Hello everybody! I am very happy to announce the beta release [1] of Nomyx, the only game where You can change the rules. This is an implementation of a Nomic [2] game in Haskell (I believe the first complete implementation). In a Nomyx game you can change the rules of the game itself while

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-27 Thread Corentin Dupont
/calvinball.jpg Tom On Tue, Feb 26, 2013 at 7:07 PM, Ben Lippmeier b...@ouroborus.net wrote: On 27/02/2013, at 10:28 , Corentin Dupont corentin.dup...@gmail.com wrote: Hello everybody! I am very happy to announce the beta release [1] of Nomyx, the only game where You can change the rules

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-27 Thread Corentin Dupont
development Cheers, Corentin On Wed, Feb 27, 2013 at 2:17 AM, Alexander Solla alex.so...@gmail.comwrote: On Tue, Feb 26, 2013 at 3:28 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hello everybody! I am very happy to announce the beta release [1] of Nomyx, the only game where You can change

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-27 Thread Corentin Dupont
Hi Chris, Thanks! That's true for the user number. What should I do? Encrypt it? On Wed, Feb 27, 2013 at 5:02 AM, Chris Wong chrisyco+haskell-c...@gmail.com wrote: Hello everybody! I am very happy to announce the beta release [1] of Nomyx, the only game where You can change the rules. I

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-27 Thread Corentin Dupont
Yes, having a cookie to keep track of the session if something I plan to do. On Wed, Feb 27, 2013 at 3:16 PM, Mats Rauhala mats.rauh...@gmail.comwrote: The user id is not necessarily the problem, but rather that you can impose as another user. For this, one solution is to keep track of a

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-27 Thread Corentin Dupont
are just more convenient. Erik On Wed, Feb 27, 2013 at 3:30 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Yes, having a cookie to keep track of the session if something I plan to do. On Wed, Feb 27, 2013 at 3:16 PM, Mats Rauhala mats.rauh...@gmail.com wrote: The user id

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-27 Thread Corentin Dupont
hash is reversible or not? On Wed, Feb 27, 2013 at 8:18 PM, Clark Gaebel cgae...@uwaterloo.ca wrote: You could just hash it. - Clark On Wed, Feb 27, 2013 at 2:08 PM, Corentin Dupont corentin.dup...@gmail.com wrote: So I need to encrypt the user ID in some way? What I need

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-27 Thread Corentin Dupont
GHCI to compose your rule, here's how: $ wget http://hackage.haskell.org/packages/archive/Nomyx-Rules/0.1.0/Nomyx-Rules-0.1.0.tar.gz $ tar -xzvf Nomyx-Rules-0.1.0.tar.gz $ ghci Nomyx-Rules-0.1.0/src/Language/Nomyx/Examples.hs Cheers! Corentin On Wed, Feb 27, 2013 at 12:28 AM, Corentin Dupont

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-27 Thread Corentin Dupont
NB: being unsubscribed, you can still watch the game. It's just that you are not anymore considered as a citizen of that game, thus not counted in the votes. On Wed, Feb 27, 2013 at 10:12 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hi all, there is quite a lot of players! Fantastic

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-27 Thread Corentin Dupont
27, 2013 at 2:08 PM, Corentin Dupont corentin.dup...@gmail.com wrote: So I need to encrypt the user ID in some way? What I need is to associate the user ID to a random number and store the association is a table? On Wed, Feb 27, 2013 at 3:52 PM, Erik Hesselink hessel...@gmail.comwrote

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-03-01 Thread Corentin Dupont
: On Wed, Feb 27, 2013 at 8:37 AM, Corentin Dupont corentin.dup...@gmail.com wrote: Hi Chris, Thanks! That's true for the user number. What should I do? Encrypt it? It's not that you have a user number, or even that it's accessible: it's that it's the entirety of access control

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-03-01 Thread Corentin Dupont
Hi all, with the mutiplayer server, the game was occasionally crashing with: CPU time limit exceeded (core dumped) I think it was due to some ulimit set too low, it should work better now. BR, C On Wed, Feb 27, 2013 at 12:28 AM, Corentin Dupont corentin.dup...@gmail.com wrote: Hello

[Haskell-cafe] Extracting exposed modules from an installed library

2013-03-19 Thread Corentin Dupont
Hi Cafe! I'm looking for how to extract the exposed modules (as a list of strings) from an installed library, giving the library name. I can see some structures in Cabal (InstalledPackageInfo) and some functions in ghc-pkg.hs in GHC, but nothing readily useable... Thanks, Corenti

Re: [Haskell-cafe] Extracting exposed modules from an installed library

2013-03-21 Thread Corentin Dupont
Hi Joachim, that's right thanks, but I was looking for a way to do that from a program. ghc-pkg does not seems to expose any library... On Wed, Mar 20, 2013 at 11:23 PM, Joachim Breitner m...@joachim-breitner.de wrote: Hi, Am Mittwoch, den 20.03.2013, 00:34 +0100 schrieb Corentin Dupont

[Haskell-cafe] Make a DSL serializable

2013-03-24 Thread Corentin Dupont
Hi Café, I have a DSL like this: data Exp where OnEvent :: EventName - (Int - Exp) - Exp (...) The OnEvent element carries a function (the handler to be called when the event happens), and that makes my DSL non showable/serializable. How could I fix that? This is a real handicap not to

Re: [Haskell-cafe] Make a DSL serializable

2013-03-24 Thread Corentin Dupont
Hi Daniel, in my game the handlers are supplied by the players as part of little programs that they submit. An haskell interpreter is reading the program code submitted and inserts it in the game. So there is an infinite number of handlers... I was thinking of hiding the parameters of the handlers

Re: [Haskell-cafe] Make a DSL serializable

2013-03-24 Thread Corentin Dupont
Allbery allber...@gmail.comwrote: On Sun, Mar 24, 2013 at 4:16 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hi Daniel, in my game the handlers are supplied by the players as part of little programs that they submit. An haskell interpreter is reading the program code submitted

Re: [Haskell-cafe] Make a DSL serializable

2013-03-24 Thread Corentin Dupont
process to run? Mike On Mar 24, 2013 5:06 PM, Brandon Allbery allber...@gmail.com wrote: On Sun, Mar 24, 2013 at 5:44 PM, Corentin Dupont corentin.dup...@gmail.com wrote: But I always bothered me that this state is not serializable... I am not quite sure how to respond to that. You seem

Re: [Haskell-cafe] Make a DSL serializable

2013-03-24 Thread Corentin Dupont
On Sun, Mar 24, 2013 at 11:05 PM, Brandon Allbery allber...@gmail.comwrote: On Sun, Mar 24, 2013 at 5:44 PM, Corentin Dupont corentin.dup...@gmail.com wrote: But I always bothered me that this state is not serializable... I am not quite sure how to respond to that. You seem to be asking

Re: [Haskell-cafe] Make a DSL serializable

2013-03-25 Thread Corentin Dupont
/3/24 Corentin Dupont corentin.dup...@gmail.com Hi Brandon, in fact, that's what I'm doing. I record the list of actions performed by the players, including the submission of the code. I serialize this list of actions instead of the state of the game. When deserializing, I replay all

Re: [Haskell-cafe] Make a DSL serializable

2013-03-25 Thread Corentin Dupont
loop step will store the result and will recover the execution state. Only the step result should be serializable. 2013/3/24 Corentin Dupont corentin.dup...@gmail.com I also came across Scala's Swarm, making use serializable delimited continuations. Looks good! http://www.scala

[Haskell-cafe] Remove redundancy with Template Haskell

2013-03-27 Thread Corentin Dupont
Hi Café, I have a function that looks like this: call :: SomeFunction - String - SomeState The string is actually the representation of the function passed in parameter. It is stored in the state for documentation. So a call looks like that: call (\a - putStrLn a) \a - putStrLn a There is a

Re: [Haskell-cafe] Remove redundancy with Template Haskell

2013-03-28 Thread Corentin Dupont
Thanks Daniel, that's very simple! Realizing this in TH seems be impossible, is it right? On Wed, Mar 27, 2013 at 10:33 PM, Daniel Trstenjak daniel.trsten...@gmail.com wrote: Hi Corentin, On Wed, Mar 27, 2013 at 09:13:41PM +0100, Corentin Dupont wrote: I have a function that looks like

[Haskell-cafe] Display an inferred type during compilation

2013-04-27 Thread Corentin Dupont
Hi Cafe, can I ask the compiler to display the type of an inferred value during compile time? It would be great if I can output a string during compilation with the type. A little bit like running :type in GHCi, but without GHCi... Because running GHCi is sometime painful (I have to clean my code

Re: [Haskell-cafe] Display an inferred type during compilation

2013-04-28 Thread Corentin Dupont
GHC with TypeHoles. Corentin On Sat, Apr 27, 2013 at 8:46 PM, Ilya Portnov port...@iportnov.ru wrote: ** В письме от 27 апреля 2013 18:55:16 пользователь Corentin Dupont написал: Hi Cafe, can I ask the compiler to display the type of an inferred value during compile time? It would be great

[Haskell-cafe] code to HTML

2013-06-03 Thread Corentin Dupont
Hello everybody, I'd like to transform a .hs file into a .html file. The objective is that the .html file, when rendered, looks exactly the same that the .hs, with the exeption that every function in the code is a link to its haddock documentation. Is that possible? The result would look like

[Haskell-cafe] voting sytem DSL

2013-06-05 Thread Corentin Dupont
Hi haskellers! I am trying to make a DSL able to describe a voting system. That DSL should be able to describe many different voting procedures: unanimity or majority, open or secret ballot, one or two turns... It should also work for referendums (yes/no question) or elections (electing one or

[Haskell-cafe] ANN: Nomyx 0.2 beta, the game where you can change the rules

2013-06-14 Thread Corentin Dupont
Hello everybody! Here it comes, the second beta release [1] of Nomyx, the only game where You can change the rules!! This is an implementation of a Nomic [2] game in Haskell (I believe the first complete implementation of a Nomic game on a computer). In a Nomyxgame you can change the rules of the

Re: [Haskell-cafe] ANN: Nomyx 0.2 beta, the game where you can change the rules

2013-06-19 Thread Corentin Dupont
, Corentin Dupont wrote: Hello everybody! Here it comes, the second beta release [1] of Nomyx, the only game where You can change the rules!! This is an implementation of a Nomic [2] game in Haskell (I believe the first complete implementation of a Nomic game on a computer). In a Nomyxgame you

[Haskell-cafe] hand over maintenance of a package

2013-06-19 Thread Corentin Dupont
Hi Cafe, How to hand over the maintenance of a hackage package? Thanks Corentin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] ANN: Nomyx 0.2 beta, the game where you can change the rules

2013-06-19 Thread Corentin Dupont
, 2013 at 01:18:54PM +0200, Corentin Dupont wrote: Thanks Brent! I'm glad you like it. You will win a lot of money if new players come :) Indeed Brent proposed a rule that allows sponsorship: if you invite a player in, you win 50 ECU... Joined a game, though I don't really have time to look

[Haskell-cafe] Fwd: MVar problem in acid-state?

2013-09-02 Thread Corentin Dupont
Hi the list, I have compiled my application on my PC, it works fine, but when I copy it on my server (same architecture), I get: Nomyx: thread blocked indefinitely in an MVar operation I don't use MVars in my application, is it possible that it's coming from acid-state? Thanks, Corentin

Re: [Haskell-cafe] Fwd: MVar problem in acid-state?

2013-09-03 Thread Corentin Dupont
. It might help if you list what version of acid-stateyou're using and what parts of it. And maybe file a bug https://github.com/acid-state/acid-state/issues upstream even if you're not sure it is acid-state. On Mon, Sep 2, 2013 at 7:35 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hi

[Haskell-cafe] ANN: Nomyx 0.3 beta, the game where you can change the rules

2013-10-02 Thread Corentin Dupont
Hello everybody! I released the third beta of Nomyx http://www.nomyx.net, the only game where You can change the rules! The second beta was a success. Great players (byorgey, nomeata, Toxaris...) proposed amazing rules, effectively building a nice universe. For example, a banking system in ecu was

  1   2   >