Re: [Haskell-cafe] Observer pattern in haskell FRP

2012-12-08 Thread Heinrich Apfelmus
Nathan Hüsken wrote: Heinrich Apfelmus wrote: In that light, the separation seems straightforward to me. Given the time-varying values that represent game objects, bSpaceShipPosition :: Behavior Position bAsteroidPositions :: Behavior [Position] bTime :: Behavior Time

Re: [Haskell-cafe] Best approach to avoid dependency hells

2012-12-08 Thread Ivan Perez
On 8 December 2012 03:12, Albert Y. C. Lai tre...@vex.net wrote: I do not understand the conflict. First you have GHC, and it comes with bytestring-0.9.2. Then one of two things happen, but I can't see a conflict either way: * You request A, but A should be fine with the existing

[Haskell-cafe] Safe Haskell safe-inferred status

2012-12-08 Thread Omari Norman
Is there a way to determine whether a module has been marked safe by GHC for purposes of Safe Haskell? The GHC 7.4 docs say that if I compile a module and I don't use the -XSafe or -XTrustworthy flag, GHC will automatically figure out whether the module would have compiled with -XSafe and, if so,

Re: [Haskell-cafe] Safe Haskell safe-inferred status

2012-12-08 Thread Roman Cheplyaka
* Omari Norman om...@smileystation.com [2012-12-08 08:34:14-0500] Is there a way to determine whether a module has been marked safe by GHC for purposes of Safe Haskell? The GHC 7.4 docs say that if I compile a module and I don't use the -XSafe or -XTrustworthy flag, GHC will automatically

[Haskell-cafe] Variable-arity zipWith (re)invented.

2012-12-08 Thread Takayuki Muranushi
Continued discussion from https://groups.google.com/d/topic/haskell-cafe/-e-xaCEbd-w/discussion https://groups.google.com/d/topic/haskell-cafe/kM_-NvXAcx8/discussion Thank you for all the answeres and thinkings; Here's zipWithN for general Zip functors: [1] . This, together with [2] may

Re: [Haskell-cafe] Best approach to avoid dependency hells

2012-12-08 Thread Albert Y. C. Lai
On 12-12-08 07:39 AM, Ivan Perez wrote: When you install A, you may not know that you'll need to depend on a lower version of bytestring later on. Cabal will pick the highest version available (0.10 if present). If a program you install later on depends on A (needs bytestring-0.10) and ghc

Re: [Haskell-cafe] Best approach to avoid dependency hells

2012-12-08 Thread Ivan Perez
I started with a clean empty .cabal dir. Then I installed some program that 1) depended on bytestring 0.10 and 2) I needed to compile another library or program. That's when the problem started. Without using cabal-dev, I see no easy way to avoid installing bytestring 0.10 when I need a program

[Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Petr P
The class is defined as class (Monoid w, Monad m) = MonadWriter w m | m - w where ... What is the reason for the Monoid constrait? It seems superfluous to me. I recompiled the whole package without it, with no problems. Of course, the Monoid constraint is necessary for most _instances_,

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Edward Z. Yang
The monoid instance is necessary to ensure adherence to the monad laws. Cheers, Edward Excerpts from Petr P's message of Sat Dec 08 10:59:25 -0800 2012: The class is defined as class (Monoid w, Monad m) = MonadWriter w m | m - w where ... What is the reason for the Monoid constrait?

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Roman Cheplyaka
* Edward Z. Yang ezy...@mit.edu [2012-12-08 11:19:01-0800] The monoid instance is necessary to ensure adherence to the monad laws. This doesn't make any sense to me. Are you sure you're talking about the MonadWriter class and not about the Writer monad? Roman

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Edward Z. Yang
Excerpts from Roman Cheplyaka's message of Sat Dec 08 14:00:52 -0800 2012: * Edward Z. Yang ezy...@mit.edu [2012-12-08 11:19:01-0800] The monoid instance is necessary to ensure adherence to the monad laws. This doesn't make any sense to me. Are you sure you're talking about the MonadWriter

[Haskell-cafe] education or experience?

2012-12-08 Thread Christopher Howard
I'm at something of a crossroads, and I'm hoping to get a bit of free career advice. I really enjoy programming with Haskell (and a few other exotic languages), and was hoping I could eventually make a living in that sort of field. Not rich and famous, necessarily, just enough to get by

[Haskell-cafe] Exploring Programming Language Theory

2012-12-08 Thread Danny Gratzer
Hello, Sorry in advance for the soft question: Recently I have been studying more about how a lazy functional language is designed and compiled and have been reading Peyton-Jones's book implementing functional languages: an introduction ___ Haskell-Cafe

Re: [Haskell-cafe] Exploring Programming Language Theory

2012-12-08 Thread Danny Gratzer
Sorry for the multiple posts, last time I try to write any decent length email from my phone... Anyways, and that was a tutorial not an introduction. I am also reading his The Implementation of Functional Programming Languages. But in any case, I'm liking these books a lot! It's super interesting

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Roman Cheplyaka
* Edward Z. Yang ezy...@mit.edu [2012-12-08 14:18:38-0800] Excerpts from Roman Cheplyaka's message of Sat Dec 08 14:00:52 -0800 2012: * Edward Z. Yang ezy...@mit.edu [2012-12-08 11:19:01-0800] The monoid instance is necessary to ensure adherence to the monad laws. This doesn't make any

Re: [Haskell-cafe] education or experience?

2012-12-08 Thread Roman Cheplyaka
* Christopher Howard christopher.how...@frigidcode.com [2012-12-08 13:26:58-0900] I'm at something of a crossroads, and I'm hoping to get a bit of free career advice. I really enjoy programming with Haskell (and a few other exotic languages), and was hoping I could eventually make a living in

Re: [Haskell-cafe] Exploring Programming Language Theory

2012-12-08 Thread Kim-Ee Yeoh
SPJ's IFPL is an excellent starting point to learn the innards of Haskell. It allows a well-acculturated individual to grab the base of the trunk and start climbing the branches, which means reading the research papers (SPJ's website, mainly though not exclusively), all the way to the leaves

Re: [Haskell-cafe] Exploring Programming Language Theory

2012-12-08 Thread Kim-Ee Yeoh
I should add that IFPL has important chapters written by authors other than Simon. -- Kim-Ee On Sun, Dec 9, 2012 at 5:58 AM, Kim-Ee Yeoh k...@atamo.com wrote: SPJ's IFPL is an excellent starting point to learn the innards of Haskell. It allows a well-acculturated individual to grab the base

Re: [Haskell-cafe] Exploring Programming Language Theory

2012-12-08 Thread Danny Gratzer
Yes sorry, I followed the link off of his website so I generalized a little. On Sat, Dec 8, 2012 at 5:00 PM, Kim-Ee Yeoh k...@atamo.com wrote: I should add that IFPL has important chapters written by authors other than Simon. -- Kim-Ee On Sun, Dec 9, 2012 at 5:58 AM, Kim-Ee Yeoh

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Kim-Ee Yeoh
The only thing we can tell from the Monad laws is that that function f should be associative. That f is associative is a very small step away from f forming a monoid. What about listen :: m a - m (w, a)? What laws should it hold that are compatible with those of the monad and those of tell?

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Holger Siegel
Am 08.12.2012 um 23:18 schrieb Edward Z. Yang: Excerpts from Roman Cheplyaka's message of Sat Dec 08 14:00:52 -0800 2012: * Edward Z. Yang ezy...@mit.edu [2012-12-08 11:19:01-0800] The monoid instance is necessary to ensure adherence to the monad laws. This doesn't make any sense to me.

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Edward Z. Yang
First of all, I don't see why two tells should be equivalent to one tell. Imagine a MonadWriter that additionally records the number of times 'tell' has been called. (You might argue that your last equation should be a MonadWriter class law, but that's a different story — we're talking about

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Edward Z. Yang
Excerpts from Holger Siegel's message of Sat Dec 08 15:27:38 -0800 2012: For deriving a monoid instance of w from monad (Writer w), you will need function execWriter:: Writer w a - w, but in case of a general instance of (MonadWriter w m) you would have to use function listen :: m a - m (a, w)

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Holger Siegel
Am 09.12.2012 um 00:27 schrieb Holger Siegel: For deriving a monoid instance of w from monad (Writer w), you will need function execWriter:: Writer w a - w, but in case of a general instance of (MonadWriter w m) you would have to use function listen :: m a - m (a, w) that will only provide

Re: [Haskell-cafe] education or experience?

2012-12-08 Thread Jerzy Karczmarczuk
Roman Cheplyaka comments a post by Christopher Howard: I'm trying to decide, however; should I go back to school, finish my B.S. and pursue a Masters in CompSci? Or would the time (and money) be better spent aggressively pursuing volunteer work for companies, hoping to eventually get the

Re: [Haskell-cafe] education or experience?

2012-12-08 Thread Rustom Mody
On Sun, Dec 9, 2012 at 7:04 AM, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: For me, opposing experience and education is simply silly. Probably more than 70% of all people would learn much faster on their own than at school. But, learn WHAT? : 1. Probably less than 1% would

Re: [Haskell-cafe] Help optimize fannkuch program

2012-12-08 Thread Branimir Maksimovic
Here it is :http://shootout.alioth.debian.org/u64/program.php?test=fannkuchreduxlang=ghcid=4 Date: Mon, 3 Dec 2012 15:32:20 -0800 Subject: Re: [Haskell-cafe] Help optimize fannkuch program From: b...@serpentine.com To: bm...@hotmail.com CC: haskell-cafe@haskell.org On Mon, Dec 3, 2012 at 11:18