[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 tes

[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 map,

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 compl

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 NamedRul

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

2013-06-19 Thread Corentin Dupont
mail under (see the forum). Best, Corentin** On Wed, Jun 19, 2013 at 1:01 PM, Brent Yorgey wrote: > This is great fun, more people should come and join us! =) > > http://www.nomyx.net:8000/Nomyx > > we are playing game "demo3". > > -Brent > > On Fri, Jun 14,

[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
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,

[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
t 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 Dupo

[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 , 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 wa

[Haskell-cafe] indentation with let and do

2013-10-03 Thread Corentin Dupont
Hi the list, why do this function doesn't compile (parse error): test :: Bool -> IO () test foo = do let bar = case foo of True -> "Foo"; False -> "Bar" return () while this one does (just adding one space in front of True and False): test :: Bool -> IO () test foo = do l

Re: [Haskell-cafe] indentation with let and do

2013-10-03 Thread Corentin Dupont
gs, it make sense... Best, Corentin On Thu, Oct 3, 2013 at 8:31 PM, Corentin Dupont wrote: > test :: Bool -> IO () > test foo = do >let bar = case foo of >True -> "Foo"; >False -> "Bar" >return ()

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

2013-10-03 Thread Corentin Dupont
There is not so much people in the game right now (only 3) and a little more watching (20). Don't be shy and join! On Thu, Oct 3, 2013 at 1:14 AM, Corentin Dupont wrote: > Hello everybody! > I released the third beta of Nomyx <http://www.nomyx.net>, the only game > wher

[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
example a rule can create a "bank account", or be executed 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 wrote: > Yes I totally agree, they have different kind.

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

2012-06-04 Thread Corentin Dupont
a signal handler for future execution). 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 wrote: > Yes I totally agree, they have different kind. A Normal Rule is * > whereas a Meta Rule

[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 tro

Re: [Haskell-cafe] event handler

2012-06-14 Thread Corentin Dupont
le -> IO ( test1 On Thu, Jun 14, 2012 at 10:05 PM, Alexander Solla wrote: > > > 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 >

Re: [Haskell-cafe] event handler

2012-06-15 Thread Corentin Dupont
h2) eventList1 trigger1 = triggerEvent (New :: Event Player) (P 1) eventList2 -- yelds "Welcome Player 1!" trigger2 = triggerEvent (New :: Event Rule) (R 2) eventList2 --yelds "New Rule* 2" Best, Corentin On Fri, Jun 15, 2012 at 12:40 AM, Alexander Solla wrote: > >

Re: [Haskell-cafe] event handler

2012-06-15 Thread Corentin Dupont
lcome Player 1!" trigger2 = triggerEvent newRule (R 2) eventList2 --Yelds "New Rule 2" * On Fri, Jun 15, 2012 at 4:53 PM, Alexander Solla wrote: > > > On Fri, Jun 15, 2012 at 6:38 AM, Corentin Dupont < > corentin.dup...@gmail.com> wrote: > >> >> It

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 D

Re: [Haskell-cafe] event handler

2012-06-16 Thread Corentin Dupont
t; > On Fri, Jun 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 * >>

Re: [Haskell-cafe] event handler

2012-06-17 Thread Corentin Dupont
trigger1 = triggerEvent NewPlayer (P 1) eventList2 --Yelds "Welcome Player 1!" trigger2 = triggerEvent NewRule (R 2) eventList2 --Yelds "New Rule 2" * Thanks again!! Corentin On Sun, Jun 17, 2012 at 12:46 AM, Alexander Solla wrote: > > > On Sat, Jun 16, 2012 at 3:31 PM

Re: [Haskell-cafe] existential types and cast

2012-07-05 Thread Corentin Dupont
one maybe you can 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 > &

Re: [Haskell-cafe] existential types and cast

2012-07-05 Thread Corentin Dupont
[Event Reaction] > > reaction f@(NewHandler _) es = return $ f:es > reaction p@(NewPlayer _) es = mapM_ (handle p) es >> return es > reaction r@(NewRule _) es = mapM_ (handle r) es >> return es > > > 2012/7/4 Corentin Dupont > >> Hi, >> for ex

Re: [Haskell-cafe] existential types and cast

2012-07-05 Thread Corentin Dupont
lifting values to > types and eliminating this information with existentials and casting seems > wrong. > > paolino > > 2012/7/4 Corentin Dupont > >> Hi Paolino, >> the user can add as many handlers he wants for each event. >> When a event is triggered along

[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 i

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

2012-07-27 Thread Corentin Dupont
a bit like cron. 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 wrote: > On Fri, Jul 27, 2012 at 5:50 AM, Corentin

[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 happst

Re: [Haskell-cafe] happstack simpleHTTP & state monad

2012-08-30 Thread Corentin Dupont
for you, while file systems don't. > > Regards, > > Erik > > On Thu, Aug 30, 2012 at 7:29 PM, Corentin Dupont > wrote: > > Hi all, > > I'm trying to make a web server that manages its own state. The user can > > issue commands that modifies the sta

[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 Strin

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: (Typeabl

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) dat

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

2012-09-11 Thread Corentin Dupont
umber 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 wrote: > Yes. > That's fantastic! This GADT is the missing piece of my puzzle. I > transform

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

2012-09-11 Thread Corentin Dupont
sure I understand > > > On Tue, Sep 11, 2012 at 11:06 AM, Corentin Dupont > 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 > flesh

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

2012-09-11 Thread Corentin Dupont
osed, you could use a GADT to witness 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

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, wrote: > > Let me see if I understand. You have events of different sorts: eve

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 w

[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... T

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 wrote: > Hi the list! > I have a simple question, how can I serialize/dese

Re: [Haskell-cafe] serialize an unknown type

2012-10-21 Thread Corentin Dupont
R, C On Sun, Oct 21, 2012 at 7:03 PM, MigMit 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 > написал(а): > > Nobody on this one? >

Re: [Haskell-cafe] serialize an unknown type

2012-10-21 Thread Corentin Dupont
er to pass an Event back to the engine. The problem is that it seems that web-routes only accepts Strings (or some known types) to be passed on the web route, whereas I need to pass random types. On Sun, Oct 21, 2012 at 8:00 PM, Iustin Pop wrote: > On Sun, Oct 21, 2012 at 07:20:10PM +0200,

Re: [Haskell-cafe] serialize an unknown type

2012-10-21 Thread Corentin Dupont
well. > > So, what is the bigger picture here? > In my application, the user can define the "a". That's what makes it difficult. For example, the user can define a new enumerate and submit it to the program (it will be interpreted by hint): data Choice = You | Me | Them

Re: [Haskell-cafe] serialize an unknown type

2012-10-24 Thread Corentin Dupont
nks, Corentin On Wed, Oct 24, 2012 at 3:37 PM, Chris Smith wrote: > "Corentin Dupont" 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) > c

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 Type

[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 a

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

2012-12-24 Thread Corentin Dupont
--If you uncomment the next line, it will work --putStrLn $ show a putMVar mv (Just $ MyData a "toto")* On Mon, Dec 24, 2012 at 1:17 PM, Corentin Dupont wrote: > Hi all, > I have a program where the user can submit his own little programs, which > are interpreted using

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

2012-12-25 Thread Corentin Dupont
int and Hint-server, and the interpretation must be done in another thread... Best, Corentin On Mon, Dec 24, 2012 at 3:46 PM, Brandon Allbery wrote: > On Mon, Dec 24, 2012 at 8:45 AM, Corentin Dupont < > corentin.dup...@gmail.com> wrote: > >> *execBlocking :: MVar (Maybe MyData) ->

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, wrote: > This seems like a bug in GHC. But it has nothing to do with MVars. I've > narrowed th

[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' -optc-I'/home/cdupont/Haskell/ghc-7.7

[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? Th

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 wrote: > On Fri, Feb 22, 2013 at 12:44 PM, Corentin Dupont > wrote: > > Hi all, > >

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

2013-02-22 Thread Corentin Dupont
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/packag

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

2013-02-22 Thread Corentin Dupont
y understand that the interpreted modules are conflicting with the compiled ones... On Fri, Feb 22, 2013 at 11:51 PM, Corentin Dupont 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

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 wrote: > I'm trying to load my interpreter in the Q monad: > > cr :: QuasiQuoter > cr = QuasiQuoter { quoteExp = quoteRuleFunc} > > quote

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

2013-02-23 Thread Corentin Dupont
Gorín wrote: > Hi Corentin, > > I've never used TH, but from what I 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, >

[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 playing

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

2013-02-27 Thread Corentin Dupont
ll.jpg > > Tom > > On Tue, Feb 26, 2013 at 7:07 PM, Ben Lippmeier wrote: > > > > On 27/02/2013, at 10:28 , Corentin Dupont > wrote: > > > >> Hello everybody! > >> I am very happy to announce the beta release [1] of Nomyx, the only > g

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

2013-02-27 Thread Corentin Dupont
uring development Cheers, Corentin On Wed, Feb 27, 2013 at 2:17 AM, Alexander Solla wrote: > > > > 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,

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 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 just gave it a go -- it

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 wrote: > 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 > unique (changing) user t

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

2013-02-27 Thread Corentin Dupont
gt; cookie. Cookies are just more convenient. > > Erik > > On Wed, Feb 27, 2013 at 3:30 PM, Corentin Dupont > 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 > > w

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 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&qu

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

2013-02-27 Thread Corentin Dupont
uleFunc". If you'd like to use 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 W

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 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
tp://hackage.haskell.org/package/snap > > Hope this helps, > Oz > > > 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 is to >> associate the

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

2013-03-01 Thread Corentin Dupont
happstack-authenticate looks impressive, they seem to support for Google , Yahoo, Live Journal, Myspace, and OpenId logins! I'll try it. On Fri, Mar 1, 2013 at 5:17 AM, Chris Wong wrote: > On Thu, Feb 28, 2013 at 1:26 PM, Brandon Allbery > wrote: > > On Wed, Feb 27, 2013 at

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 wrote: > Hello everybody! > I am very ha

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

2013-03-03 Thread Corentin Dupont
Hi all, it's still crashing once a day with: CPU time limit exceeded (core dumped) ulimit -t gives unlimited. in /etc/security/limits.conf their is nothing. I'm not setting time limits in the software. Any ideas? On Fri, Mar 1, 2013 at 3:33 PM, Corentin Dupont wrote: > Hi al

[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 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

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
M, Brandon Allbery wrote: > 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 t

Re: [Haskell-cafe] Make a DSL serializable

2013-03-24 Thread Corentin Dupont
r process to run? > > Mike > On Mar 24, 2013 5:06 PM, "Brandon Allbery" 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... >

Re: [Haskell-cafe] Make a DSL serializable

2013-03-24 Thread Corentin Dupont
On Sun, Mar 24, 2013 at 11:05 PM, Brandon Allbery 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 t

Re: [Haskell-cafe] Make a DSL serializable

2013-03-25 Thread Corentin Dupont
nce. > > > 2013/3/24 Corentin Dupont > >> 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. Wh

Re: [Haskell-cafe] Make a DSL serializable

2013-03-25 Thread Corentin Dupont
handler <- liftIO $ compile eventhandlercode >liftIO $ execute handler >loop > > step will store the result and will recover the execution state. > Only the step result should be serializable. > > > 2013/3/24 Corentin Dupont > >> I al

[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

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: >

[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 f

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

2013-04-28 Thread Corentin Dupont
next GHC with TypeHoles. Corentin On Sat, Apr 27, 2013 at 8:46 PM, Ilya Portnov 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? &g

[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 that:

[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 seve

[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 g

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ó wrote: > Hello folks ! > I am a Computer Science student looking for an internship of 6 months here > in France. Does anybody know

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 = St

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

2010-11-08 Thread Corentin Dupont
ate. That is > likely to be fairly disruptive to your current design. But it ensures that > every event is saved. > > If you merely want periodic checkpoints, you can use happstack-data and > just write the state out periodically. > > hope this helps! > > If I have still not answer

[Haskell-cafe] web-routes and forms

2011-01-08 Thread Corentin Dupont
o ["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 Dupont &g

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

2011-01-09 Thread Corentin Dupont
for the upcoming release. Clearly things like the FormInput > instance and the formPart function belong a library. > > let me know if you have more questions. > - jeremy > > On Sat, Jan 8, 2011 at 6:44 PM, Corentin Dupont > wrote: > > Hello, > > > > I have di

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

2011-01-13 Thread Corentin Dupont
utes-mtl > digestive-functors > digestive-functors-hsp > > I plan to clean up this example and document it better in the crash > course for the upcoming release. Clearly things like the FormInput > instance and the formPart function belong a library. > > let me know if you

[Haskell-cafe] Happstack events and web page refreshing

2011-01-17 Thread Corentin Dupont
k 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 wrote: > Hello, > >

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

2011-01-17 Thread Corentin Dupont
le, if updating > only once a minute is fine versus must update every second. > > Once you decide how 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: >

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

2011-01-17 Thread Corentin Dupont
n, 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'

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

2011-01-19 Thread Corentin Dupont
nuary 2011 21:50, Jeremy Shaw wrote: > > > > On Jan 17, 2011, at 2:19 PM, Corentin Dupont wrote: > > > > Indeed, I tried with ? > > and it's unusable. > > It make blink the page, ungrey the "stop" button for a second and make > the > > f

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

2011-01-19 Thread Corentin Dupont
to patch it and upload a new version. > > - jeremy > > > On Thu, Jan 13, 2011 at 2:40 PM, Corentin Dupont > wrote: > > Hello, > > > > I'm using the combination happstack + digestive-functors + web-routes + > > blazeHTML. > > I'm not find

  1   2   >