Re: [Haskell-cafe] About using "type" to do type alias.

2012-06-25 Thread Arlen Cuss
mapM > > > > On Mon, Jun 25, 2012 at 5:04 PM, Arlen Cuss > (mailto:a...@len.me)> wrote: > > > Magicloud, > > > > > > Try to reduce the particular problem you're having to the smallest > > > possible example that reproduces t

Re: [Haskell-cafe] About using "type" to do type alias.

2012-06-25 Thread Arlen Cuss
Magicloud, Try to reduce the particular problem you're having to the smallest possible example that reproduces the issue. None of us can compile your code, either, because we're missing many of the dependencies, and unfortunately the issue is no easier (for me) to track down with the full sourc

Re: [Haskell-cafe] Martin Odersky on "What's wrong with Monads"

2012-06-24 Thread Arlen Cuss
> In standard ML you can start doing effect-based things inside a function > without having to alter its type and they type of everything that uses it, > and so on. This in turn causes a break-down in the type-system where weak type variables are introduced. We can see the pathological case for

Re: [Haskell-cafe] What extension do I need to write "type Job = Map k a"?

2012-06-14 Thread Arlen Cuss
n 14, 2012 at 12:28 PM, Ivan Lazar Miljenovic > > > > mailto:ivan.miljeno...@gmail.com)> wrote: > > > > > On 14 June 2012 14:20, Magicloud Magiclouds > > > > > > > > > (mailto:magicloud.magiclo...@gmail.com)> wrote: > > > > > > OK. I think I und

Re: [Haskell-cafe] What extension do I need to write "type Job = Map k a"?

2012-06-13 Thread Arlen Cuss
(resending to café, turns out I wasn't subbed from this address.) Hi Magicloud, This is correct; because you've hidden the type-variables away by universally quantifying them, there's no more level of specificity you can get back *out* of them than just "some kind of Map" (Job = M.Map k b, where

Re: [Haskell-cafe] Simon PJ in Australia

2011-08-19 Thread Arlen Cuss
You heard it here first; Simon's down here in Aus to "eat pizza, university departments, Haskell users groups". Will he leave nothing left!? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Haskell syntax highlighting in a public blog

2011-08-08 Thread Arlen Cuss
9/08/2011 11:54 AM, Oscar Picasso kirjutas: > Hi, > > Is there a public blog that that allow syntax highlighting of Haskell code? Are you talking about a plugin for a blog engine? CodeColourer on WordPress will do it. Arlen ___ Haskell-Cafe mailing li

Re: [Haskell-cafe] XCode Dependency for HP on Mac

2011-07-26 Thread Arlen Cuss
27/07/2011 4:25 PM, Tom Murphy kirjutas: > On 7/27/11, Richard O'Keefe wrote: > >> A quick web search for "Mac OS X gcc binary" turned up >> http://hpc.sourceforge.net/index.php >> with binary releases of GCC 4.6 for Lion and Snow Leopard. >> >> This requires "Developer Tools", but that isn't XCo

Re: [Haskell-cafe] XCode Dependency for HP on Mac

2011-07-26 Thread Arlen Cuss
27/07/2011 3:27 PM, Maciej Wos kirjutas: > If you're using Lion you can get Xcode from the App Store (Apple used > to charge something for it, but now it is free). > > If you're using Snow Leopard you can download Xcode from > developer.apple.com/xcode. See "Looking for Xcode 3? Download Now" in >

Re: [Haskell-cafe] For class Monoid; better names than mempty & mappend might have been: mid (mident) & mbinop

2011-07-23 Thread Arlen Cuss
On 24.07.2011 08:20, Ivan Lazar Miljenovic wrote: > On 24 July 2011 04:41, KC wrote: >> It would be easier for beginners to "grok". I quite like mempty/mappend; they (f)map onto the [] instance as a mnemonic. Similarly, MonadPlus (as a concept) maps to mzero/mplus quite well (and it's distinguis

[Haskell-cafe] Why the reluctance to introduce the Functor requirement on Monad?

2011-07-21 Thread Arlen Cuss
Hi cafe! I feel a bit like I'm speaking out of turn for bringing this up -- and I'm sure it must have been brought up many times before -- but I hope there can be something fruitful had from a discussion. In my travels I've read several people with much better grasp of Haskell than I have mention

Re: [Haskell-cafe] Network.CGI and SQL Queries

2011-07-20 Thread Arlen Cuss
> When I remove the "scoresPassed <- sqlReaderIO" line, the code run > smoothly. Nothing else references "scoresPassed". The ghc, however, > gives me this error when the line is included: I'm not 100% sure, but what if you put a liftM or liftIO in somewhere? > (liftM output) . renderHtml $ ...

Re: [Haskell-cafe] question regarding the $ apply operator

2011-07-19 Thread Arlen Cuss
> Just curious, the following is not allowed in Haskell either for the > same reason. > > applySkip i f ls = (take i) ls ++ $ f $ drop i ls This doesn't work for a slightly different reason; you can't use the infix operators beside each other ("++ $"), but if you could, it'd work! __

Re: [Haskell-cafe] question regarding the $ apply operator

2011-07-18 Thread Arlen Cuss
> applySkip i f ls = (take i) ls ++ f (drop i ls) > > But the following doesn't: > > applySkip i f ls = (take i) ls ++ f $ drop i ls The issue is with operator precedence. The above is equivalent to: > applySkip i f ls = ((take i) ls ++ f) (drop i ls) (++) binds more strongly than ($). __

Re: [Haskell-cafe] Category theory as a design tool

2011-06-21 Thread Arlen Cuss
On 22/06/2011 2:24 PM, Daniel Peebles wrote: > Hey, I think you forgo Hahah, this reminds me of the time I onc ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Why aren't there anonymous sum types in Haskell?

2011-06-21 Thread Arlen Cuss
> import Data.Either > type (:|:) a b = Either a b > (???) = either > > foo :: (Int :|: Bool :|: String :|: Double) -> Int > foo = > \ i -> i + 7 ??? > \ b -> if b then 1 else 0 ??? > \ s -> length s ??? > \ d -> floor d INFIX TYPE OPERATORS!!??! O_

Re: [Haskell-cafe] Conditional IO ?

2011-06-20 Thread Arlen Cuss
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 20/06/11 18:00, Dmitri O.Kondratiev wrote: > Hi, > What is right way to do conditional IO? > For example, I need to write to file errors only in case they exist, > otherwise my function should do nothing: > > handleParseErrors errors > | (not . n

Re: [Haskell-cafe] Best Linux Distro for >>=

2011-06-18 Thread Arlen Cuss
In no particular order, the following seem to have good Linux support: Gentoo, Arch, Fedora and Debian (I think Testing). Please allow me to register my amusement at the idea of a distribution "with good Linux support". :D ___ Haskell-Cafe mailing

Re: [Haskell-cafe] best way to use ghc-7.0 under debian stable

2011-06-10 Thread Arlen Cuss
> Should I abandon the ghc debian package and install the haskell-platform ? > Should I simply build ghc 7.0 independently ? This is the way I went; I installed the latest ghc from source, then haskell-platform from source. Works a treat! Arlen signature.asc Description: This is a digitally

Re: [Haskell-cafe] Can't access map value with key.

2011-05-21 Thread Arlen Cuss
On Sat, 2011-05-21 at 04:56 -0700, michael rice wrote: > (fromList > [(("\n","\n"),["I"]),(("\n","I"),["am"]),(("I","am"),["lost."])],("am","lost."),[]) Or splitting that out: (fromList [(("\n","\n"),["I"]),(("\n","I"),["am"]),(("I","am"),["lost."])], ("am","lost."), []) Note that it's a triple,

Re: [Haskell-cafe] Can't access map value with key.

2011-05-20 Thread Arlen Cuss
On Fri, 2011-05-20 at 19:04 -0700, michael rice wrote: > markov4.hs:35:27: Couldn't match expected type `Map k a' > against inferred type `(Map Prefix [String], Prefix, [String])' ghc seems to believe `mp' here is not just a map, but the entire state (which is what execState is meant to give