Re: [Haskell-cafe] what does the '~' mean ?

2010-04-15 Thread Ivan Miljenovic
On 16 April 2010 15:59, zaxis wrote: > > instance (BinaryDefer a, BinaryDefer b) => BinaryDefer (a,b) where >    put (a,b) = put2 a b >    get = get2 (,) >    size x = let ~(a,b) = x in size a + size b >    putFixed (a,b) = putFixed2 a b >    getFixed = getFixed2 (,) > > in `size` function, what d

[Haskell-cafe] what does the '~' mean ?

2010-04-15 Thread zaxis
instance (BinaryDefer a, BinaryDefer b) => BinaryDefer (a,b) where put (a,b) = put2 a b get = get2 (,) size x = let ~(a,b) = x in size a + size b putFixed (a,b) = putFixed2 a b getFixed = getFixed2 (,) in `size` function, what does the `~` mean ? Sincerely! - fac n

Re: [Haskell-cafe] Why does the transformers/mtl 'Error' class exist?

2010-04-15 Thread Ryan Ingram
It's used in the implementation of "fail" for those monads. class Monad m where ... fail :: String -> m a fail = error -- default implementation which is then used to desugar do-notation when pattern matching fails: do Left x <- something return x => something

[Haskell-cafe] Why does the transformers/mtl 'Error' class exist?

2010-04-15 Thread John Millikin
Both the transformers[1] and mtl[2] define a class named 'Error', for use with MonadError and ErrorT. This class is required for the instance of Monad (and therefore MonadTrans, MonadIO, etc). However, I can't figure out why this class exists. Its presence means that instead of something like: ---

[Haskell-cafe] Re: Nomic game in Haskell

2010-04-15 Thread Ashley Yakeley
On 2010-04-15 17:39, Dan Piponi wrote: In the service of readability we could also define: data X = X data O In that case we'd want type Three a b c = (a,b,c) ...which is simpler than my GADT. -- Ashley Yakeley ___ Haskell-Cafe mailing list Has

[Haskell-cafe] Re: Nomic game in Haskell

2010-04-15 Thread Dan Piponi
On Thu, Apr 15, 2010 at 4:58 PM, Ashley Yakeley wrote: > type Board a b c d e f g h i = >  Either (Three a b c) >  (Either (Three d e f) >  (Either (Three g h i) >  (Either (Three a d g) >  (Either (Three b e h) >  (Either (Three c f i) >  (Either (Three a e i) >  (Either (Three c e g) >  )))

[Haskell-cafe] auto-recompile (Re: Haskell web dev - ASP .NET analogue?)

2010-04-15 Thread Simon Michael
Re the auto-recompiling part, here is one of my favourite tools. I have used it to auto-build happstack, yesod and hakyll apps/sites: # "continuous integration" - recompile and restart # whenever a module changes. sp is from searchpath.org, you might # need the patched version from http://joyful

[Haskell-cafe] Re: Nomic game in Haskell

2010-04-15 Thread Ashley Yakeley
On 2010-04-15 14:00, Dan Piponi wrote: (A neutral third party will have to implement Board.) data Three a b c where { MkThree :: Three () () () } type Board a b c d e f g h i = Either (Three a b c) (Either (Three d e f) (Either (Three g h i) (Either (Three a d g) (Either (Three b e h)

[Haskell-cafe] Haskell web dev - ASP .NET analogue?

2010-04-15 Thread Christopher Done
The state of Haskell web development is exciting and messy. We don't have a de facto way to do it like Rails or Django or ASP .NET, but we do have many imitations and ideas popping up. You can easily judge whether the community is happy with the state of web development by the number of new web fra

[Haskell-cafe] Re: Building regex-posix for windows

2010-04-15 Thread Mikhail Glushenkov
Hi, Станислав Черничкин gmail.com> writes: > > > I'm having > trouble building regex-posix for Windows [...] See this thread: http://thread.gmane.org/gmane.comp.lang.haskell.libraries/12721 Basically, you need to checkout the darcs version which includes C sources for libregex and hack the .

Re: [Haskell-cafe] Building regex-posix for windows

2010-04-15 Thread Stephen Tetley
Hi Ivan I believe that regex-posix (Haskell) is expecting regex.h to be the 'standard posix' header file. The versions of MinGW / MSys I'm using from around Christmas last year didn't ship with a Posix regex implementation, though this might have changed now. I seem to remember that GNU Posix was

Re: [Haskell-cafe] Building regex-posix for windows

2010-04-15 Thread Ivan Lazar Miljenovic
Станислав Черничкин writes: > I'm having trouble building regex-posix for Windows under MinGW > because MinGW does not include regex.h. Which version of regex-posix is this? I think this might be a bug in regex-posix's .cabal file: the darcs repo seems to contain a regex.h which should probably

Re: [Haskell-cafe] Building regex-posix for windows

2010-04-15 Thread Jason Dagit
2010/4/15 Станислав Черничкин > I'm having trouble building regex-posix for Windows under MinGW because > MinGW does not include regex.h. As far as I know Haskell Platform uses MinGW > and it includes regex-posix. I'd like to build regex-posix by myself, like > Haskell Platform does. I would app

Re: [Haskell-cafe] Building regex-posix for windows

2010-04-15 Thread Stephen Tetley
Hello You can build GNU's regex C-library with MinGW from source and this will give you regex.h and libregex.a / libregex.dll. I think I've only had the Haskell regex-posix package half-working doing this though; i.e. I could build and install regex-posix after I'd made and installed GNU regex, b

Re: [Haskell-cafe] Nomic game in Haskell

2010-04-15 Thread Dan Piponi
Dupont asked: > do you know Nomic? > It's a fabulous and strange game where you have the right to change the rules > in the middle of the game! I know nomic, but as has been pointed out, it's too wide-ranging to be captured in Haskell. So how about a game played in the Haskell type system where

Re: [Haskell-cafe] Automating injections: adding a type parameter

2010-04-15 Thread Romulus
Clear and concise answer. Thank you. On Thu, Apr 15, 2010 at 21:24, Daniel Fischer wrote: > Am Donnerstag 15 April 2010 19:19:15 schrieb Romulus: > > Hello everyone, > > > > > > > I'm stuck with the definition of the helper for LAnd'. I expect : > > > > land' :: ((LAnd' p) :<: (f p)) => Mu (f p

Re: [Haskell-cafe] Automating injections: adding a type parameter

2010-04-15 Thread Daniel Fischer
Am Donnerstag 15 April 2010 19:19:15 schrieb Romulus: > Hello everyone, > > > I'm stuck with the definition of the helper for LAnd'. I expect : > > land' :: ((LAnd' p) :<: (f p)) => Mu (f p) -> Mu (f p) -> Mu (f p) > land' = \x y -> inject (LAnd' x y) > > ... but ghci 6.10.4 does not really lik

[Haskell-cafe] Re: instance Eq (a -> b)

2010-04-15 Thread Ashley Yakeley
On 2010-04-15 06:18, Nick Bowler wrote: Your definitions seem very strange, because according to this, the functions f :: Double -> Double f x = 1/x and g :: Double -> Double g x = 1/x are not equal, since (-0.0 == 0.0) yet f (-0.0) /= g (0.0). There's an impedance mismatch b

[Haskell-cafe] Building regex-posix for windows

2010-04-15 Thread Станислав Черничкин
I'm having trouble building regex-posix for Windows under MinGW because MinGW does not include regex.h. As far as I know Haskell Platform uses MinGW and it includes regex-posix. I'd like to build regex-posix by myself, like Haskell Platform does. I would appreciate it if someone suggests some r

[Haskell-cafe] Automating injections: adding a type parameter

2010-04-15 Thread Romulus
Hello everyone, It's my very first post to this mailing list, though i read it for several months. I'm very interested in Swiertra's automatic injection technique [1]. http://www.cse.chalmers.se/~wouter//Publications/DataTypesALaCarte.pdf

[Haskell-cafe] Re: Fwd: Re: Simple game: a monad for each player

2010-04-15 Thread Heinrich Apfelmus
Limestraël wrote: >> I'd like to make it very accessible, so please don't hesitate to report >> any difficulties with finding and understanding documentation and examples! > > Then I think the name 'Prompt' may be misleading for those who doesn't know > the MonadPrompt package. Maybe something like

Re: [Haskell-cafe] Re: Fwd: Re: Simple game: a monad for each player

2010-04-15 Thread Limestraël
There is the project. I changed some little things with the player datatype. For flexibility sake, it's stack has no longer to contain PlayerMonadT (I needed it for the net player client) The most interesting part (the one that deals with operational) is in TicTacToe/Game.hs This is not very, ve

Re: [Haskell-cafe] Re: instance Eq (a -> b)

2010-04-15 Thread Alexander Solla
On Apr 15, 2010, at 12:53 AM, rocon...@theorem.ca wrote: I'd call them disrespectful functions, or maybe nowadays I might call them improper functions. The "good" functions are respectful functions or proper functions. There's no need to put these into a different class. The IEEE defined

Re: [Haskell-cafe] Re: cabal: other-modules

2010-04-15 Thread Casey McCann
On Thu, Apr 15, 2010 at 10:45 AM, Dougal Stanton wrote: > 'Morally' seems just the perfect word for this occasion --- concerned > with right or proper conduct. In this case, potential discrepancies > between the files that cabal 'knows' about when issuing different > commands; or the sense of dece

Re: [Haskell-cafe] Re: cabal: other-modules

2010-04-15 Thread Dougal Stanton
On Thu, Apr 15, 2010 at 1:49 PM, Ivan Lazar Miljenovic wrote: > Johannes Waldmann writes: >> What happened was this: >> I still don't see why this "other-modules" is needed. >> Ok, I understand the technical reason that cabal >> does not do dependency analysis but morally, it should? > > Why are

Re: [Haskell-cafe] Re: instance Eq (a -> b)

2010-04-15 Thread Nick Bowler
On 03:53 Thu 15 Apr , rocon...@theorem.ca wrote: > On Wed, 14 Apr 2010, Ashley Yakeley wrote: > > > On 2010-04-14 14:58, Ashley Yakeley wrote: > >> On 2010-04-14 13:59, rocon...@theorem.ca wrote: > >> > >>> There is some notion of value, let's call it proper value, such that > >>> bottom is n

Re: [Haskell-cafe] True Random Numbers

2010-04-15 Thread Yitzchak Gale
Christopher Done wrote: > betterStdGen :: IO StdGen Here's what I have been using. It's a bit more complete. Of course, you can always use mkStdGen with it to get one of those if you want. (Yes, I often do that. StdGen is much maligned, but it's pretty good at what it's designed for.) Regards, Yi

Re: [Haskell-cafe] ANN: haskell-src-exts 1.9.0

2010-04-15 Thread Ross Paterson
On Thu, Apr 15, 2010 at 10:52:51AM +0200, Sean Leather wrote: > Any idea why the Haddock docs have not been generated for this > version? There's also no "built on" available. Is it an issue with > the server? A glitch when I was switching the builds to use cabal install --dry-run. ___

Re: [Haskell-cafe] Re: cabal: other-modules

2010-04-15 Thread Ivan Lazar Miljenovic
Johannes Waldmann writes: > What happened was this: > I still don't see why this "other-modules" is needed. > Ok, I understand the technical reason that cabal > does not do dependency analysis but morally, it should? Why are people suddenly using the term "morally" when they mean "why doesn't th

Re: [Haskell-cafe] Re: cabal: other-modules

2010-04-15 Thread José Pedro Magalhães
Hi, On Thu, Apr 15, 2010 at 14:40, Johannes Waldmann < waldm...@imn.htwk-leipzig.de> wrote: > What happened was this: > > 1. add some modules to a library (but forget to mention them in the cabal > file), > then (in the lib source dir, without cleaning/reconfiguring) > "cabal install --global

[Haskell-cafe] Re: cabal: other-modules

2010-04-15 Thread Johannes Waldmann
What happened was this: 1. add some modules to a library (but forget to mention them in the cabal file), then (in the lib source dir, without cleaning/reconfiguring) "cabal install --global" (runs without complaint) 2. re-compile an application that uses the library (cabal configure &&

Re: [Haskell-cafe] ANN: haskell-src-exts 1.9.0

2010-04-15 Thread Ivan Lazar Miljenovic
Sean Leather writes: > Yes, version 1.9.0 of haskell-src-exts was uploaded on "Sun Apr 11 10:43:03 > UTC 2010," but the ghc build is dated as modified on "15-Apr-2010 02:42" (in > some unknown timezone) according the log < > http://hackage.haskell.org/packages/archive/haskell-src-exts/1.9.0/logs/s

Re: [Haskell-cafe] What is the consensus about -fwarn-unused-do-bind ?

2010-04-15 Thread Henning Thielemann
John Meacham schrieb: > On Fri, Apr 09, 2010 at 09:07:29AM -0700, Bryan O'Sullivan wrote: >> On Fri, Apr 9, 2010 at 6:44 AM, Ivan Lazar Miljenovic < >> ivan.miljeno...@gmail.com> wrote: >>> As of 6.12.1, the new -fwarn-unused-do-bind warning is activated with >>> -Wall. This is based off a bug rep

Re: [Haskell-cafe] ANN: haskell-src-exts 1.9.0

2010-04-15 Thread Sean Leather
> > > Hmm, now it does. Apparently, the server saw my email and responded > > nicely. > > Well, it takes half an hour or so... > Yes, version 1.9.0 of haskell-src-exts was uploaded on "Sun Apr 11 10:43:03 UTC 2010," but the ghc build is dated as modified on "15-Apr-2010 02:42" (in some unknown tim

Re: [Haskell-cafe] Can't login to GHC trac

2010-04-15 Thread Daniel Fischer
Am Donnerstag 15 April 2010 05:38:23 schrieb Jason Dagit: > On Tue, Apr 13, 2010 at 3:47 AM, Erik de Castro Lopo > > > > wrote: > > > > Daniel Fischer wrote: > > > Am Dienstag 13 April 2010 09:29:18 schrieb Erik de Castro Lopo: > > > > Anyone else have the same problem? > > > > > > I have that pro

Re: [Haskell-cafe] ANN: haskell-src-exts 1.9.0

2010-04-15 Thread Ivan Lazar Miljenovic
Sean Leather writes: > Hmm, now it does. Apparently, the server saw my email and responded > nicely. Well, it takes half an hour or so... -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Has

Re: [Haskell-cafe] cabal: other-modules

2010-04-15 Thread Malcolm Wallace
On 15 Apr 2010, at 08:24, Johannes Waldmann wrote: What is the purpose of the "Other-Modules" section in a cabal file? (I.e., can we drop it?) If it's just the set of dependencies of the "Exported-Modules", then a reasonable build system should be able to figure this out on its own. It is

Re: [Haskell-cafe] ANN: haskell-src-exts 1.9.0

2010-04-15 Thread Sean Leather
On Thu, Apr 15, 2010 at 12:00, Ivan Lazar Miljenovic < ivan.miljeno...@gmail.com> wrote: > Sean Leather writes: > >> I'm pleased to announce the release of haskell-src-exts-1.9.0! > >> > >> * On hackage: http://hackage.haskell.org/package/haskell-src-exts > >> > > > > Any idea why the Haddock doc

Re: [Haskell-cafe] Re: True Random Numbers

2010-04-15 Thread Yitzchak Gale
Since they weren't mentioned in this thread, I'll point out that there are better sources of entropy than /dev/random, /dev/urandom, and the Windows API. For example, the two sites https://random.org/integers https://www.fourmilab.ch/hotbits/secure_generate.html both offer free random bits via a

Re: [Haskell-cafe] cabal: other-modules

2010-04-15 Thread Ivan Lazar Miljenovic
Johannes Waldmann writes: > What is the purpose of the "Other-Modules" section in a cabal file? > (I.e., can we drop it?) Non-exported modules. > If it's just the set of dependencies of the "Exported-Modules", > then a reasonable build system should be able to figure this out on > its own. Exp

Re: [Haskell-cafe] ANN: haskell-src-exts 1.9.0

2010-04-15 Thread Ivan Lazar Miljenovic
Sean Leather writes: >> I'm pleased to announce the release of haskell-src-exts-1.9.0! >> >> * On hackage: http://hackage.haskell.org/package/haskell-src-exts >> > > Any idea why the Haddock docs have not been generated for this version? > There's also no "built on" available. Is it an issue with

Re: [Haskell-cafe] Can't install Criterion package on ghc ..

2010-04-15 Thread stefan kersten
On 13.04.10 14:46, Mozhgan kabiri wrote: > I am trying to install Criterion package, but I keep getting an error > and I can't figure it out why it is like this !! [...] > [8 of 9] Compiling Data.Vector.Algorithms.Intro ( > Data/Vector/Algorithms/Intro.hs, dist/build/Data/Vector/Algorithms/Intro.o

Re: [Haskell-cafe] Re: Fwd: Re: Simple game: a monad for each player

2010-04-15 Thread Limestraël
Ok, but there is no function such as mapMonad in the operational package? By the way, I noticed that ProgramT is not automatically made instance of MonadIO when possible. It could be: instance (MonadIO m) => MonadIO (ProgramT r m) where liftIO = lift . liftIO Is that intentional? ( In fact, I

Re: [Haskell-cafe] Nomic game in Haskell

2010-04-15 Thread Dupont Corentin
Yes indeed, Nomic couldn't be fully coded, only a subset of it could be. Rules that are outside of the box cannot be expressed, the goal is, to have the largest box possible! Your rule: * Players must stand when proposing new rules. couldn't be coded directly, of course, since the computer has no

Re[2]: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-15 Thread Bulat Ziganshin
Hello Neil, Thursday, April 15, 2010, 12:37:35 PM, you wrote: > I find non-termination with a much simpler program than yours (GHC 6.12.1): >forkIO $ do putStrLn "Started thread" >forever $ return () ghc multithreading is actually cooperative: it switches only on memory alloc

Re: [Haskell-cafe] ANN: haskell-src-exts 1.9.0

2010-04-15 Thread Sean Leather
Hi Niklas, > I'm pleased to announce the release of haskell-src-exts-1.9.0! > > * On hackage: http://hackage.haskell.org/package/haskell-src-exts > Any idea why the Haddock docs have not been generated for this version? There's also no "built on" available. Is it an issue with the server? Regar

Re: [Haskell-cafe] GHC, odd concurrency space leak

2010-04-15 Thread Neil Brown
Jason Dagit wrote: On Wed, Apr 14, 2010 at 3:13 PM, Daniel Fischer mailto:daniel.is.fisc...@web.de>> wrote: Am Mittwoch 14 April 2010 23:49:43 schrieb Jason Dagit: > > It will be interesting to hear what fixes this! > > > > > > forever' m = do _ <- m > >

[Haskell-cafe] Re: instance Eq (a -> b)

2010-04-15 Thread Ashley Yakeley
On Thu, 2010-04-15 at 03:53 -0400, rocon...@theorem.ca wrote: > Hmm, I guess I'm carrying all this over from the world of dependently > typed programming where we have setoids and the like that admit equality > relations that are not necessarily decidable. In Haskell only the > decidable instan

[Haskell-cafe] Re: Fwd: Re: Simple game: a monad for each player

2010-04-15 Thread Heinrich Apfelmus
Limestraël wrote: > Okay, I start to understand better... > > Just, Heinrich, how would implement the mapMonad function in terms of the > operational package? > You just shown the signature. Ah, that has to be implemented by the library, the user cannot implement this. Internally, the code would

[Haskell-cafe] Re: instance Eq (a -> b)

2010-04-15 Thread roconnor
On Wed, 14 Apr 2010, Ashley Yakeley wrote: On 2010-04-14 14:58, Ashley Yakeley wrote: On 2010-04-14 13:59, rocon...@theorem.ca wrote: There is some notion of value, let's call it proper value, such that bottom is not one. In other words bottom is not a proper value. Define a proper value to

[Haskell-cafe] cabal: other-modules

2010-04-15 Thread Johannes Waldmann
What is the purpose of the "Other-Modules" section in a cabal file? (I.e., can we drop it?) If it's just the set of dependencies of the "Exported-Modules", then a reasonable build system should be able to figure this out on its own. The current situation is that I have to manage this list manuall