Re: [Haskell-cafe] Invitation to connect on LinkedIn

2012-09-16 Thread Ramana Kumar
On Wed, Sep 12, 2012 at 7:21 PM, damodar kulkarni kdamodar2...@gmail.comwrote: Hi, Correct me if I am wrong, but by looking at the way the message is created, I think, LinkedIn is acting a kind of spammer these days. Shall we lodge protest against it as a community? I'd support such a

Re: [Haskell-cafe] Could not find module `Text.Regex'

2012-09-16 Thread Gaoang Liu
yeah , cabal install regex.compat fixes my problems ,2 . Thx . On Friday, January 29, 2010 11:51:23 AM UTC+8, zaxis wrote: import Text.Regex date_by_ntday dateStr ntday = do let [y,m,d] = map (\x - read x::Int) $ splitRegex (mkRegex -) dateStr %ghc --version The

[Haskell-cafe] cost-centre names

2012-09-16 Thread Marco Túlio Pimenta Gontijo
Hi. I have a question about cost-centre names, as shown on .hp files produced by +RTS -hc. They have the form A/B/C/D/E/F/G/... Usually, it seems that it means A, called by B, called by C, etc, but that's not the case sometimes. I have a case here (called with -L200):

[Haskell-cafe] Type error with Type families

2012-09-16 Thread Marco Túlio Pimenta Gontijo
Hi. I cannot make this program type check: {-# LANGUAGE TypeFamilies, FlexibleContexts #-} import qualified Data.ListLike as LL class LL.ListLike full (Item full) = ReplaceOneOf full where type Item full :: * replaceOneOf :: [Item full] - full - full - full

Re: [Haskell-cafe] Type error with Type families

2012-09-16 Thread MigMit
It shoudn't typecheck. Suppose you have instances like instance ReplaceOneOf Foo where type Item Foo = Baz element = elementFoo instance ReplaceOneOf Bar where type Item Bar = Baz element = elementBar Now if you call replaceOneOf manyBazs foo1 foo2, Haskell should consult element ::

Re: [Haskell-cafe] Transforming a ADT to a GADT

2012-09-16 Thread José Pedro Magalhães
Hi Florian, Will this do? class Tc a where tc :: Exp - Maybe (Term a) instance Tc Int where tc (Lit i) = return (TLit i) tc (Succ i) = tc i = return . TSucc tc (IsZero i) = Nothing tc e= tcIf e instance Tc Bool where tc (Lit i) = Nothing tc (Succ i)

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

2012-09-16 Thread Tillmann Rendel
Hi, Kristopher Micinski wrote: Everyone in the Haskell cafe probably has a secret dream to give the best five minute monad talk. (1) Most programming languages support side effects. There are different kinds of side effects such as accessing mutable variables, reading files, running in

Re: [Haskell-cafe] cost-centre names

2012-09-16 Thread Felipe Almeida Lessa
On Sun, Sep 16, 2012 at 7:57 AM, Marco Túlio Pimenta Gontijo marcotmar...@gmail.com wrote: I have a question about cost-centre names, as shown on .hp files produced by +RTS -hc. They have the form A/B/C/D/E/F/G/... Usually, it seems that it means A, called by B, called by C, etc, but that's

[Haskell-cafe] Dynamic Programming with Data.Vector

2012-09-16 Thread Myles C. Maxfield
Hello, I've been writing dynamic programming (dp) algorithms in imperative languages for years, and I was thinking recently about how to use it in a Haskell context. In particular, I want to write a function that takes an ordered collection of items and produces a new item to insert into the

[Haskell-cafe] [ANNOUNCE] Juicy.Pixels v2.0

2012-09-16 Thread Vincent Berthoux
Hello, I'm pleased to announce the release of Juicy.Pixels (a pure Haskell library for image loading and writing) in version 2.0. The new features of this version are a Gif file decoder, and a rework of the plane extraction part to be type safe github:

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

2012-09-16 Thread Conal Elliott
Hi Tillmann. Wow. Lovely and spot on! And I almost never hear monad explanations without wincing. Thanks for sharing. -- Conal On Sun, Sep 16, 2012 at 7:48 AM, Tillmann Rendel ren...@informatik.uni-marburg.de wrote: Hi, Kristopher Micinski wrote: Everyone in the Haskell cafe probably has

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

2012-09-16 Thread Kristopher Micinski
Agreed. Great. I still contend that it would be cool to get this to be a real thing at something like the Haskell workshop, I think hearing the different perspectives would be an interesting insight into the many different ways to explain monads. But I suppose the way to start would be to put

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

2012-09-16 Thread Kristopher Micinski
Agreed. Great. I still contend that it would be cool to get this to be a real thing at something like the Haskell workshop, I think hearing the different perspectives would be an interesting insight into the many different ways to explain monads. But I suppose the way to start would be to put

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

2012-09-16 Thread MigMit
Mind if I join you in praising this? On Sep 17, 2012, at 12:06 AM, Kristopher Micinski krismicin...@gmail.com wrote: Agreed. Great. I still contend that it would be cool to get this to be a real thing at something like the Haskell workshop, I think hearing the different perspectives would

Re: [Haskell-cafe] Dynamic Programming with Data.Vector

2012-09-16 Thread Myles C. Maxfield
Someone replied saying that I could use a HashMap and a fold to do this, and that solution should work quite well. Bonus points if there's a solution without the space overhead of a hashmap :-) I'm hoping for an unboxed vector. --Myles On Sun, Sep 16, 2012 at 12:40 PM, Myles C. Maxfield

Re: [Haskell-cafe] What is the good way to work with list comprehension and UTCTime?

2012-09-16 Thread Richard O'Keefe
On 15/09/2012, at 5:14 AM, Chris Heller wrote: You might want to have a look at the time-recurrence package: http://hackage.haskell.org/package/time-recurrence For your simple cases you would do something like: Each second: starting (UTCTime ...) $ recur secondly Each minute:

Re: [Haskell-cafe] What is the good way to work with list comprehension and UTCTime?

2012-09-16 Thread Antoine Latter
On Sun, Sep 16, 2012 at 5:04 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On 15/09/2012, at 5:14 AM, Chris Heller wrote: You might want to have a look at the time-recurrence package: http://hackage.haskell.org/package/time-recurrence For your simple cases you would do something like:

Re: [Haskell-cafe] What is the good way to work with list comprehension and UTCTime?

2012-09-16 Thread Heller Time
Antoine has it right, the language is lifted from the RFC. Chris Heller SAS - Advanced Analytics Teragram Research Development phone: 1-617-576-6800 x54237 mobile: 1-617-460-3643 email: hel...@teragram.com On Sep 16, 2012, at 7:14 PM, Antoine Latter aslat...@gmail.com wrote: On Sun, Sep 16,

Re: [Haskell-cafe] Either Monad and Laziness

2012-09-16 Thread wren ng thornton
On 9/14/12 5:16 PM, Eric Velten de Melo wrote: But now I'm kinda lost. Is there an easy way to explain the difference between: -iteratee -conduit -enumerator John Lato's iteratee library is the original one based on Oleg Kiselyov's work. I've used it a fair deal and am quite fond of it.