Re: [Haskell-cafe] partial inheritance

2011-07-19 Thread Maciej Piechotka
On Tue, 2011-07-19 at 10:43 +0200, Yves Parès wrote: I haven't followed the thread carefully but why does the bird have to be a penguin? A bird doesn't have to be a penguin : instance (Penguin b) = Bird b where fly = -- fly method for penguins Says that every Penguin is a Bird.

Re: [Haskell-cafe] Maybe use advice

2011-06-06 Thread Maciej Piechotka
On Tue, 2011-06-07 at 04:09 +0800, Lyndon Maydwell wrote: (missed including cafe) f :: [Modification] - Maybe [Modification] and f _ = Just $ f ... are incompatible My bad: f ... = let cs' = (Rotate (x+x') : fromMaybe cs (f cs)) in fromMaybe cs (f cs) Or refactoring it: g l =

Re: [Haskell-cafe] ANNOUNCE: iteratee-compress 0.2.0.0

2011-04-26 Thread Maciej Piechotka
On Mon, 2011-04-25 at 15:47 +0900, Conrad Parker wrote: On 23 April 2011 19:29, Maciej Piechotka uzytkown...@gmail.com wrote: Iteratee-compress provides compressing and decompressing enumerators including flushing (using John Lato's implementation). Currently only gzip and bzip is provided

[Haskell-cafe] ANNOUNCE: iteratee-compress 0.2.0.0

2011-04-23 Thread Maciej Piechotka
Iteratee-compress provides compressing and decompressing enumerators including flushing (using John Lato's implementation). Currently only gzip and bzip is provided but LZMA is planned. Changes from previous version: - Add BZip support Next goals: - LZMA support - Generic interface for

Re: [Haskell-cafe] There is no null; Maybe/Option types

2011-04-22 Thread Maciej Piechotka
On Fri, 2011-04-22 at 22:11 +0200, Henning Thielemann wrote: On Fri, 22 Apr 2011, Maciej Marcin Piechotka wrote: On Fri, 2011-04-22 at 21:26 +0200, Henning Thielemann wrote: In idiomatic Haskell you would write case userList of Nothing - Nothing Just plainUserList =

Re: [Haskell-cafe] GHC 7.0.2 and haddock

2011-03-05 Thread Maciej Piechotka
On Sun, 2011-03-06 at 02:56 +0100, Daniel Fischer wrote: On Sunday 06 March 2011 02:34:58, Maciej Marcin Piechotka wrote: Is there any version of haddock that builds with ghc 7.0.2? The source tarball comes with 2.9.2, that built and works here. While 2.9.2 is not on hackage, you could try

Re: [Haskell-cafe] iteratee-compress space leak?

2011-02-20 Thread Maciej Piechotka
On Fri, 2011-02-18 at 17:27 +0300, Michael A Baikov wrote: I am trying to play with iteratee making parser for squid log files, but found that my code do not run in constant space when it tries to process compressed log files. So i simplified my code down to this snippet: import

Re: [Haskell-cafe] iteratee-compress space leak?

2011-02-18 Thread Maciej Piechotka
On Fri, 2011-02-18 at 17:27 +0300, Michael A Baikov wrote: I am trying to play with iteratee making parser for squid log files, but found that my code do not run in constant space when it tries to process compressed log files. So i simplified my code down to this snippet: import

[Haskell-cafe] ANN: nanoparsec 0.1.1

2011-01-30 Thread Maciej Piechotka
Nanoparsec is currently simply a port of attoparsec on the ListLike (the abstraction of lists used by iteratee). It allows to achive in parsing a near-attoparsec levels of speed (benchmarks from attoparsec library shown a 0.450 ± 0.028 for attoparsec, 0.479 ± 0.043 for nanoparsec and 1.532 ±

Re: [Haskell-cafe] ANN: nanoparsec 0.1.1

2011-01-30 Thread Maciej Piechotka
On Sun, 2011-01-30 at 13:13 -0200, Felipe Almeida Lessa wrote: On Sun, Jan 30, 2011 at 1:03 PM, Maciej Piechotka uzytkown...@gmail.com wrote: It allows to achive in parsing a near-attoparsec levels of speed (benchmarks from attoparsec library shown a 0.450 ± 0.028 for attoparsec, 0.479

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-28 Thread Maciej Piechotka
On Thu, 2011-01-27 at 19:36 -0500, wren ng thornton wrote: On 1/27/11 2:21 PM, Maciej Piechotka wrote: On Thu, 2011-01-27 at 00:45 -0500, wren ng thornton wrote: On 1/26/11 5:51 AM, Maciej Piechotka wrote: Some projects (like Linux) remove this clause and I'm not sure how many projects

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-26 Thread Maciej Piechotka
On Tue, 2011-01-25 at 22:21 -0800, John Millikin wrote: On Tue, Jan 25, 2011 at 22:14, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: However, my understanding that this property is then transitive: if Foo is GPL, Bar depends on Foo and Baz depends on Bar, then Baz must also be

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-26 Thread Maciej Piechotka
On Wed, 2011-01-26 at 08:11 +0100, Ketil Malde wrote: David Leimbach leim...@gmail.com writes: BSD3 doesn't really state anything about what it links with, but the GPL injects itself into the tree of stuff it's linked with via the derivative works clause. I'm not an IP lawyer

Re: [Haskell-cafe] Proposal: Applicative = Monad: Call for consensus

2011-01-25 Thread Maciej Piechotka
On Mon, 2011-01-24 at 20:13 -0800, Ryan Ingram wrote: On Fri, Jan 21, 2011 at 7:58 PM, Casey Hawthorne cas...@istar.ca wrote: uj supplied this: About the discussion putStrLn (readLn + (5 :: Int)).. I'll write it as the following line, importing Control.Applicative main = (+)

Re: [Haskell-cafe] Proposal: Applicative = Monad: Call for consensus

2011-01-25 Thread Maciej Piechotka
On Tue, 2011-01-25 at 12:17 +0100, Gábor Lehel wrote: On Tue, Jan 25, 2011 at 10:20 AM, Ketil Malde ke...@malde.org wrote: Erik Hesselink hessel...@gmail.com writes: importing Control.Applicative main = print = liftM2 (+) readLn (return 3) [...] line noise Why not just: main =

[Haskell-cafe] Is SHE (the Strathclyde Haskell Enhancement) portable?

2011-01-23 Thread Maciej Piechotka
It may be strange question but: - Is SHE portable (assuming that the compiler have the extensions)? - If yes why there is only information how to use it with GHC? Regards signature.asc Description: This is a digitally signed message part ___

Re: [Haskell-cafe] Is SHE (the Strathclyde Haskell Enhancement) portable?

2011-01-23 Thread Maciej Piechotka
On Sun, 2011-01-23 at 18:42 +0100, Lennart Augustsson wrote: It probably is portable, but I'd think only GHC has all the necessary extensions. I imagine some parts (idiom brackets) works with minimal amount of extentions - maybe it would be benefitial to have instructions to run SHE with other

Re: [Haskell-cafe] parsec2 vs. parsec3... again

2011-01-13 Thread Maciej Piechotka
On Wed, 2011-01-12 at 18:15 -0800, Evan Laforge wrote: On Mon, Dec 27, 2010 at 6:51 AM, Evan Laforge qdun...@gmail.com wrote: I've uploaded attoparsec-text and attoparsec-text-enumerator to Hackage. I've written those packages late last week and asked for Very nice! I'll download this

Re: [Haskell-cafe] ANN: nanoparsec 0.1

2011-01-10 Thread Maciej Piechotka
On Sun, 2011-01-09 at 16:54 +, Magnus Therning wrote: On 09/01/11 00:46, Maciej Piechotka wrote: Nanoparsec is currently simply a port of attoparsec on the ListLike (the abstraction of lists used by iteratee). It allows to achive in parsing a near-attoparsec levels of speed

[Haskell-cafe] ANN: nanoparsec 0.1

2011-01-08 Thread Maciej Piechotka
Nanoparsec is currently simply a port of attoparsec on the ListLike (the abstraction of lists used by iteratee). It allows to achive in parsing a near-attoparsec levels of speed (benchmarks from attoparsec library shown a 0.450 ± 0.028 for attoparsec, 0.479 ± 0.043 for nanoparsec and 1.532 ±

Re: [Haskell-cafe] getting last char of String

2011-01-01 Thread Maciej Piechotka
On Sat, 2011-01-01 at 19:27 +1100, Jesse Schalken wrote: On Sat, Jan 1, 2011 at 8:54 AM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Fri, Dec 31, 2010 at 6:43 PM, aditya siram aditya.si...@gmail.com wrote: -- untested and won't work on an infinite list

Re: [Haskell-cafe] getting last char of String

2011-01-01 Thread Maciej Piechotka
On Sat, 2011-01-01 at 19:27 +1100, Jesse Schalken wrote: On Sat, Jan 1, 2011 at 8:54 AM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Fri, Dec 31, 2010 at 6:43 PM, aditya siram aditya.si...@gmail.com wrote: -- untested and won't work on an infinite list

Re: [Haskell-cafe] getting last char of String

2011-01-01 Thread Maciej Piechotka
On Sat, 2011-01-01 at 19:27 +1100, Jesse Schalken wrote: On Sat, Jan 1, 2011 at 8:54 AM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Fri, Dec 31, 2010 at 6:43 PM, aditya siram aditya.si...@gmail.com wrote: -- untested and won't work on an infinite list

Re: [Haskell-cafe] parsec2 vs. parsec3... again

2010-12-24 Thread Maciej Piechotka
On Thu, 2010-12-23 at 18:38 +0200, Michael Snoyman wrote: On Thu, Dec 23, 2010 at 6:21 PM, Johan Tibell johan.tib...@gmail.com wrote: On Thu, Dec 23, 2010 at 3:03 PM, Felipe Almeida Lessa felipe.le...@gmail.com wrote: Michael Snoyman wants attoparsec-text as well [1]. [1]

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-24 Thread Maciej Piechotka
On Fri, 2010-12-24 at 05:36 -0500, Edward Kmett wrote: +1 for adding Comonads. As an aside, since Haskell doesn't have (nor could it have) coexponential objects, there is no 'missing' Coapplicative concept that goes with it, so there can be no objection on the grounds of lack of symmetry

Re: [Haskell-cafe] UTF-8 in Haskell.

2010-12-23 Thread Maciej Piechotka
On Thu, 2010-12-23 at 14:15 +0800, Magicloud Magiclouds wrote: On Thu, Dec 23, 2010 at 2:01 PM, Mark Lentczner ma...@glyphic.com wrote: On Dec 22, 2010, at 9:29 PM, Magicloud Magiclouds wrote: Thus under all situation (ascii, UTF-8, or even UTF-32), my program always send 4 bytes through

Re: [Haskell-cafe] [Haskell] Functor = Applicative = Monad

2010-12-15 Thread Maciej Piechotka
On Wed, 2010-12-15 at 13:51 +0200, John Smith wrote: On 15/12/2010 11:39, Lennart Augustsson wrote: Any refutable pattern match in do would force MonadFail (or MonadPlus if you prefer). So 1. (MonadFail m) = a - m a, \ a - return a 2. (MonadFail m) = m a, mfail ... 3.

Re: [Haskell-cafe] Rendering of hask in new wiki (MSIE6)

2010-12-15 Thread Maciej Piechotka
On Wed, 2010-12-15 at 09:01 -0500, Dimitry Golubovsky wrote: Hi, In MSIE6, hask tags are rendered like this (from the Monad_Transformers page): transformers: provides the classes MonadTrans and MonadIO , as well as concrete monad transformers such as StateT ... etc. The Wiki

Re: [Haskell-cafe] Rendering of hask in new wiki (MSIE6)

2010-12-15 Thread Maciej Piechotka
On Wed, 2010-12-15 at 17:56 +, Neil Mitchell wrote: Hi In general I'd say that MSIE should be avoided and updated to newer version like 7 or 8 (according to wikipedia they should be avaible for Windows XP - or at least they were available when Windows XP was supported) - IE6 have

Re: [Haskell-cafe] dot-ghci files

2010-12-11 Thread Maciej Piechotka
On Thu, 2010-12-09 at 14:01 -0500, Albert Y. C. Lai wrote: On 10-12-09 01:57 PM, Claus Reinke wrote: Perhaps ghc should also ignore all group-writable *.hs, *.lhs, *.c, *.o, *.hi files. dot-ghci files are *run* if you just start ghci (or ghc -e) in that directory (even if you don't

Re: [Haskell-cafe] dot-ghci files

2010-12-11 Thread Maciej Piechotka
On Thu, 2010-12-09 at 17:01 +1000, Tony Morris wrote: I teach haskell quite a lot. I recommend using .ghci files in projects. Today I received complaints about the fact that ghci will reject .ghci if it is group-writeable. I didn't offer an opinion on the matter. I am wondering if these

Re: [Haskell-cafe] ANNOUNCE: mime-mail 0.1.0

2010-12-09 Thread Maciej Piechotka
On Thu, 2010-12-09 at 11:53 +0200, Michael Snoyman wrote: On Thu, Dec 9, 2010 at 11:48 AM, Magnus Therning mag...@therning.org wrote: On Wed, Dec 8, 2010 at 19:11, Michael Snoyman mich...@snoyman.com wrote: Hi all (again), I'm happy to announce the second major release of the mime-mail[1]

Re: [Haskell-cafe] ANNOUNCE: mime-mail 0.1.0

2010-12-08 Thread Maciej Piechotka
On Wed, 2010-12-08 at 21:11 +0200, Michael Snoyman wrote: Hi all (again), I'm happy to announce the second major release of the mime-mail[1] package. mime-mail is a package providing support for rendering multipart emails. This new release introduces: * A partHeaders record, allowing you

[Haskell-cafe] Hackage have ghc 7.0 false positives builds

2010-12-05 Thread Maciej Piechotka
Hackage seems to hae false positive builds. For example llvm is reported to have been built with ghc despite problems with cabal (type errors and after quick'n'dirty fix it has errors). Regards signature.asc Description: This is a digitally signed message part

[Haskell-cafe] Re: Transparent identity instances

2010-11-29 Thread Maciej Piechotka
On Sun, 2010-11-28 at 22:59 +0800, Jafet wrote: {-# LANGUAGE TypeSynonymInstances #-} type Identity a = a instance Applicative Identity where -- something like pure a = a f * a = f a But GHC does not accept type synonym instances unless they are fully applied. Is it sound

[Haskell-cafe] ANNOUNCE: iteratee-compress 0.1.2

2010-11-28 Thread Maciej Piechotka
Iteratee-compress provides compressing and decompressing enumerators including flushing. Currently only gzip is provided but at bzip and LZMA are planned. This is bug-fixing release Changes from previous version: - Fix infinite loop/segfault bug - Fix bug in which part of the output was lost

[Haskell-cafe] ANNOUNCE: iteratee-compress 0.1.2

2010-11-28 Thread Maciej Piechotka
Iteratee-compress provides compressing and decompressing enumerators including flushing. Currently only gzip is provided but at bzip and LZMA are planned. This is bug-fixing release Changes from previous version: - Fix infinite loop/segfault bug - Fix bug in which part of the output was lost

[Haskell-cafe] ANNOUNCE: iteratee-parsec 0.0.6

2010-11-28 Thread Maciej Piechotka
Iteratee-parsec is a library which allows to have a parsec (3) parser in Iteratee monad. It contains 2 implementations: - John Lato's on public domain. It is based on monoid and design with short parsers in mind. - Mine on MIT. It is based on single-linked mutable list. It seems to be

[Haskell-cafe] Re: ANNOUNCE: iteratee-compress 0.1.2

2010-11-28 Thread Maciej Piechotka
On Sun, 2010-11-28 at 15:24 +, Maciej Piechotka wrote: Iteratee-compress provides compressing and decompressing enumerators including flushing. Currently only gzip is provided but at bzip and LZMA are planned. This is bug-fixing release Changes from previous version: - Fix infinite

[Haskell-cafe] Re: version of findIndex that works with a monadic predicate

2010-11-26 Thread Maciej Piechotka
On Sat, 2010-11-27 at 02:23 +0300, Miguel Mitrofanov wrote: findIndexM = (liftM (findIndex id) .) . mapM Not quite. Compare: findIndexM (\x - print x return True) [1,2,3] or findIndexM (\x - if x == 2 then Nothing else Just True) [1,2,3] Possibly better: findIndexM p = foldr (\(n, y) x -

[Haskell-cafe] Re: Re: Reply-To: Header in Mailinglists

2010-11-22 Thread Maciej Piechotka
On Sun, 2010-11-21 at 08:24 +, Malcolm Wallace wrote: If the mailing list replaced Reply-To header it would required additional effort for responders instead of just pressing reply-to- all. If the list were to add a Reply-To: header, but only in the case where one was not already

[Haskell-cafe] Re: Re: Reply-To: Header in Mailinglists (was: About Fun with type functions example)

2010-11-20 Thread Maciej Piechotka
On Fri, 2010-11-19 at 15:25 +0100, Arnaud Bailly wrote: I personnally use most of the time gmail, so I don't have access to a Reply-To-List feature (or do I?). I usually do Reply-to-all which I think is as I guess most mailers remove duplicate mails. Am I right? Arnaud As message have the

[Haskell-cafe] Re: Reply-To: Header in Mailinglists (was: About Fun with type functions example)

2010-11-19 Thread Maciej Piechotka
On Fri, 2010-11-19 at 04:55 +0100, Bastian Erdnüß wrote: Hi there, I just put an answer two this in beginn...@haskell.org. It was not on purpose to move the topic. It's just that questions I feel I can answer are usually beginner level questions and so I'm not often writing in the cafe

[Haskell-cafe] Re: Re: typeclass namespace rational?

2010-11-16 Thread Maciej Piechotka
On Tue, 2010-11-16 at 00:55 -0500, Daniel Peebles wrote: If I were to guess, I'd say it's because there are two major spaces in Haskell, the type level and the value level. They never interact directly (their terms are never juxtaposed) so there's not much chance for confusion. Typeclass

[Haskell-cafe] Re: http://functionalley.eu

2010-11-06 Thread Maciej Piechotka
On Sat, 2010-11-06 at 15:10 +, Alistair Ward wrote: I opted to host them there rather than uploading them to Hackage, because they're part of a wider project. You can upload to hackage packages hosted (like webpage, code repo, bug tracker...) elsewhere - it similar to Ubuntu (or insert

[Haskell-cafe] Re: Is let special?

2010-11-03 Thread Maciej Piechotka
On Wed, 2010-11-03 at 18:05 +0100, Petr Pudlak wrote: Hi Günther, from the semantical point of view, you can replace let x = e' in e by (\x - e) e' Both should evaluate to the same thing. You also need (sometimes) fix function let xs = 1:xs in xs and fix (\xs - 1:xs)

[Haskell-cafe] Re: Decoupling type classes (e.g. Applicative)?

2010-11-03 Thread Maciej Piechotka
On Tue, 2010-11-02 at 21:57 -0400, Brandon S Allbery KF8NH wrote: On 10/29/10 09:35 , Dominique Devriese wrote: * Only introduce a dependency from type class A to type class B if all functions in type class B can be implemented in terms of the functions in type class A or if type class

[Haskell-cafe] Re: cabal mystery (#562?)

2010-10-30 Thread Maciej Piechotka
On Thu, 2010-10-28 at 15:33 +0200, Daniel Fischer wrote: On Thursday 28 October 2010 15:08:09, Conor McBride wrote: Any tips to keep the gremlins at bay gratefully appreciated. Don't feed after midnight, don't get them wet, I think were the tips. Don't expose to bright light. Regards

[Haskell-cafe] ANNOUNCE: iteratee-compress 0.1.1

2010-10-24 Thread Maciej Piechotka
Iteratee-compress provides compressing and decompressing enumerators including flushing. Currently only gzip is provided but at least bzip is planned. Changes from previous version: - Independent from zlib library (Haskell one, not C) - Allow hand-flushing the contents (from outside). - Fix

[Haskell-cafe] Re: ANNOUNCE: iteratee-compress 0.1.1

2010-10-24 Thread Maciej Piechotka
On Sun, 2010-10-24 at 15:03 -0400, wren ng thornton wrote: On 10/24/10 7:09 AM, Maciej Piechotka wrote: Iteratee-compress provides compressing and decompressing enumerators including flushing. Currently only gzip is provided but at least bzip is planned. Changes from previous version

Re: [Haskell-cafe] Re: ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-10 Thread Maciej Piechotka
On 10/10/10, Michael Snoyman mich...@snoyman.com wrote: On Fri, Oct 8, 2010 at 3:29 PM, Maciej Piechotka uzytkown...@gmail.com wrote: I had in mind something like: import Data.ByteString import Data.Iteratee clientEnum :: MonadIO m = params - Enumerator ByteString m

Re: [Haskell-cafe] Re: ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-09 Thread Maciej Piechotka
On Sat, 2010-10-09 at 09:27 +0100, Vincent Hanquez wrote: On Fri, Oct 08, 2010 at 12:59:56PM +0100, Maciej Piechotka wrote: 1. Could also callback in addition to handles be added? Like: connect' :: (ByteString - IO ()) - IO ByteString - TLSClient IO () Would an interface

[Haskell-cafe] Re: ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Maciej Piechotka
On Wed, 2010-10-06 at 22:26 +0100, Vincent Hanquez wrote: Hi haskellers, I'ld like to announce the tls package [1][2], which is a native implementation of the TLS protocol, client and server. It's currently mostly supporting SSL3, TLS1.0 and TLS1.1. It's got *lots* of rough edges, and a

Re: [Haskell-cafe] Re: ANNOUNCE: tls, native TLS/SSL protocol implementation

2010-10-08 Thread Maciej Piechotka
On Fri, 2010-10-08 at 15:14 +0200, Michael Snoyman wrote: On Fri, Oct 8, 2010 at 1:59 PM, Maciej Piechotka uzytkown...@gmail.com wrote: On Wed, 2010-10-06 at 22:26 +0100, Vincent Hanquez wrote: Hi haskellers, I'ld like to announce the tls package [1][2], which is a native

[Haskell-cafe] Re: Coding conventions for Haskell?

2010-09-26 Thread Maciej Piechotka
On Sun, 2010-09-26 at 11:40 +0200, Petr Pudlak wrote: Hi Johan, On Sat, Sep 25, 2010 at 01:44:07PM +0200, Johan Tibell wrote: Quite a few people follow my style guide http://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md which codifies the style used in Real World

[Haskell-cafe] Re: Coding conventions for Haskell?

2010-09-26 Thread Maciej Piechotka
On Sat, 2010-09-25 at 13:44 +0200, Johan Tibell wrote: On Sat, Sep 25, 2010 at 11:24 AM, Petr Pudlak d...@pudlak.name wrote: sometimes I have doubts how to structure my Haskell code - where to break lines, how much to indent, how to name functions and variables etc. Are there any

[Haskell-cafe] Re: Unified Haskell login

2010-09-20 Thread Maciej Piechotka
On Sun, 2010-09-19 at 17:12 +0200, Michael Snoyman wrote: Let me respond to this directly since a number of people have brought this up: Due to spam reasons we can't trust the email given via an OpenID provider in general. For example, it would be trivial for me to create an OpenID

[Haskell-cafe] Re: Unified Haskell login

2010-09-18 Thread Maciej Piechotka
On Fri, 2010-09-17 at 08:47 +0200, Michael Snoyman wrote: Hi cafe, Let me preface this by stating that this is purposely a half-baked idea, a straw man if you will. I'd like to hear what the community thinks about this. I mentioned yesterday that I was planning on building haskellers.com.

[Haskell-cafe] Re: Ultra-newbie Question

2010-09-18 Thread Maciej Piechotka
On Sat, 2010-09-18 at 03:51 -0400, Christopher Tauss wrote: Hello Haskell Community - I am a professional programmer with 11 years experience, yet I just do not seem to be able to get the hang of even simple things in Haskell. I am trying to write a function that takes a list and returns

Re: [Haskell-cafe] Full strict functor by abusing Haskell exceptions

2010-09-14 Thread Maciej Piechotka
On Tue, 2010-09-14 at 11:27 +0100, Neil Brown wrote: On 13/09/10 17:25, Maciej Piechotka wrote: import Control.Exception import Foreign import Prelude hiding (catch) data StrictMonad a = StrictMonad a deriving Show instance Monad StrictMonad where return x = unsafePerformIO

[Haskell-cafe] Full strict functor by abusing Haskell exceptions

2010-09-13 Thread Maciej Piechotka
I started experiment with strict functors. I come to: import Control.Exception import Foreign import Prelude hiding (catch) data StrictMonad a = StrictMonad a deriving Show instance Functor StrictMonad where f `fmap` StrictMonad v = return $ f v instance Applicative StrictMonad

[Haskell-cafe] Re: [Haskell] ANNOUNCE: reference 0.1

2010-09-07 Thread Maciej Piechotka
On Tue, 2010-09-07 at 02:15 +0200, Bas van Dijk wrote: On Mon, Sep 6, 2010 at 11:55 PM, Maciej Piechotka uzytkown...@gmail.com wrote: Reference is class which generalizes references and monads they exists in. It means that IORef, STRef and others can be accessed by common interface

[Haskell-cafe] Re: Re: [Haskell] ANNOUNCE: reference 0.1

2010-09-07 Thread Maciej Piechotka
On Tue, 2010-09-07 at 20:36 +0200, Alberto G. Corona wrote: Why not to define it for any monad, for example STM (TVars) and whatever? I'm really sorry but I fail to see what does 'it' refers to. reference 0.1 contains at this moment definitions for: - Reference TVar STM - Reference IORef IO -

[Haskell-cafe] Re: ANNOUNCE: countable-0.1

2010-09-06 Thread Maciej Piechotka
On Mon, 2010-09-06 at 03:54 -0700, Ashley Yakeley wrote: countable: Countable, Searchable, Finite, Empty classes. class Countable, for countable types class AtLeastOneCountable, for countable types that have at least one value class InfiniteCountable, for infinite countable types

[Haskell-cafe] Re: overloaded list literals?

2010-09-06 Thread Maciej Piechotka
On Mon, 2010-09-06 at 10:23 +, Johannes Waldmann wrote: We have overloaded numerical literals (Num.fromInteger) and we can overload string literals (IsString.fromString), so how about using list syntax ( [], : ) for anything list-like (e.g., Data.Sequence)? Of course some minor details

[Haskell-cafe] Re: questions about Arrows

2010-09-01 Thread Maciej Piechotka
On Tue, 2010-08-31 at 20:39 -0700, Ben wrote: Hello -- Three related questions, going from most specific to most general : 1 ) Consider the stream processing arrow which computes a running sum, with two implementations : first using generic ArrowCircuits (rSum); second using Automaton

Re: [Haskell-cafe] Re: questions about Arrows

2010-09-01 Thread Maciej Piechotka
On Wed, 2010-09-01 at 11:49 -0700, Ben wrote: Thanks for the prompt reply. Some questions / comments below : On Wed, Sep 1, 2010 at 12:33 AM, Maciej Piechotka uzytkown...@gmail.com wrote: rSum2 :: ArrowCircuit a = a Int Int rSum2 = proc x - do rec out - delay 0 - out + x

[Haskell-cafe] ANNOUNCE: iteratee-compress 0.1

2010-08-31 Thread Maciej Piechotka
Iteratee-compress provides compressing and decompressing enumerators. Currently only gzip is provided but at least bzip is planned. Additionally more fine-control over stream (i.e. flushing) is planned. Library currently depends on zlib haskell library only for sharing parameters data.

[Haskell-cafe] Re: Crypto-API is stabilizing

2010-08-27 Thread Maciej Piechotka
On Mon, 2010-08-23 at 10:05 -0700, Thomas DuBuisson wrote: All, Crypto-API - a unified interface to which I hope hash and cipher algorithms will adhere - has recently gotten a reasonable amount of polish work. I continue to welcome all comments! A blog on its current interface is online

[Haskell-cafe] FRP - style

2010-08-27 Thread Maciej Piechotka
I wanted to learn something about FRP. I tried to use existing packages on hackage and write something in OpenGL but I failed - mainly due to problem of handling single occurrence of event[1]. I tried to write my own library (https://patch-tag.com/r/uzytkownik/reactive-event/home) and I'd like to

[Haskell-cafe] Re: ANNOUNCE: hs-cryptohash 0.4

2010-07-02 Thread Maciej Piechotka
On Fri, 2010-07-02 at 20:10 +1000, Ivan Lazar Miljenovic wrote: Vincent Hanquez t...@snarc.org writes: On Fri, Jul 02, 2010 at 12:55:03PM +1000, Ivan Miljenovic wrote: On 1 July 2010 17:25, Vincent Hanquez t...@snarc.org wrote: The main reason for this library is the lack of incremental

[Haskell-cafe] Re: specifying package name in ghci import?

2010-06-29 Thread Maciej Piechotka
On Mon, 2010-06-28 at 19:29 -0700, Michael Vanier wrote: Hi, Quick question about ghci: when I do this at the prompt: ghci :m +Control.Monad.Cont I get Ambiguous module name `Control.Monad.Cont': it was found in multiple packages: mtl-1.1.0.2 monads-fd-0.0.0.1 Is there

[Haskell-cafe] TypeFamillies and UndecidableInstances - why?

2010-06-22 Thread Maciej Piechotka
When I tried to do something like: {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} class Test a where type TestMonad a :: * - * from :: a b - TestMonad a b to :: TestMonad a b - a b data Testable a b = Testable (a b) instance (Test a, Functor

[Haskell-cafe] Re: TypeFamillies and UndecidableInstances - why?

2010-06-22 Thread Maciej Piechotka
On Tue, 2010-06-22 at 21:51 -0400, Brandon S. Allbery KF8NH wrote: On Jun 22, 2010, at 21:41 , Maciej Piechotka wrote: test.hs:11:0: Constraint is no smaller than the instance head in the constraint: Functor (TestMonad a) (Use -XUndecidableInstances to permit

[Haskell-cafe] Re: Re: What is Haskell unsuitable for?

2010-06-19 Thread Maciej Piechotka
On Sat, 2010-06-19 at 03:12 +0200, Henning Thielemann wrote: Maciej Piechotka schrieb: 1. Glueing a few highier level, object-oriented libraries if it is just glueing. 2. (Currently) AFAIK real-time applications although it is rather property of GHC GC then the language itself

[Haskell-cafe] Re: What is Haskell unsuitable for?

2010-06-16 Thread Maciej Piechotka
On Wed, 2010-06-16 at 10:34 +0200, David Virebayre wrote: On Wed, Jun 16, 2010 at 8:00 AM, Michael Snoyman mich...@snoyman.com wrote: Next you'll say there's no need for anyone to ask whether they prefer vi or emacs... ;-) Of course *real* programmers use ed. It is the standard

[Haskell-cafe] Re: What is Haskell unsuitable for?

2010-06-15 Thread Maciej Piechotka
On Tue, 2010-06-15 at 19:47 -0400, aditya siram wrote: Hi all, Haskell is a great language and in a lot of ways it still hasn't found a niche, but that's part of what is great about it. But I wanted to ask people are more experienced with Haskell - what kinds of problems is it unsuited

[Haskell-cafe] Reactive and 'real live' problem

2010-06-14 Thread Maciej Piechotka
I tried to experiment with reactive[1] and rewrite NeHe tutorials using reactive-glut. However I run into problems. I tried to write first tutorial and exit on escape. However there were 2 problems: 1. Optimized constant functions 2. Continuous behaviour In reactive the final step is Behaviour

Re: [Haskell-cafe] Re: Using the ContT monads for early exits of IO ?

2010-06-11 Thread Maciej Piechotka
On Thu, 2010-06-10 at 21:21 +0100, Ben Millwood wrote: On Thu, Jun 10, 2010 at 8:57 PM, Maciej Piechotka uzytkown...@gmail.com wrote: Error monad seems not to be a semantic solution as we exit on success not failure. Which is really why the Either monad should not necessarily have

[Haskell-cafe] Re: How to Show an Operation?

2010-06-10 Thread Maciej Piechotka
On Thu, 2010-06-10 at 19:44 +0200, Martin Drautzburg wrote: On Thursday, 10. June 2010 00:08:34 Luke Palmer wrote: Or just: apply = val_of So, to summarize: if you have something that isn't a function and you want to use it like a function, convert it to a function (using another

[Haskell-cafe] Re: Using the ContT monads for early exits of IO ?

2010-06-10 Thread Maciej Piechotka
On Thu, 2010-06-10 at 14:09 -0500, Tim Wawrzynczak wrote: Actually, on second thought, Lennart is probably right. Continuations are probably overkill for this situation. Since not wanting to continue is probably an 'erroneous condition,' you may as well use Error. Cheers, - Tim

[Haskell-cafe] Re: GATD and pattern matching

2010-06-09 Thread Maciej Piechotka
On Wed, 2010-06-09 at 22:28 +0200, Dupont Corentin wrote: Thanks for your response. How would you do it? I design this GATD for a game i'm making: data Obs a where Player :: Obs Integer Turn :: Obs Integer Official :: Obs Bool Equ :: Obs a - Obs a - Obs Bool

[Haskell-cafe] Re: Re: Re: Difference between div and /

2010-06-07 Thread Maciej Piechotka
On Thu, 2010-06-03 at 06:48 -0700, mo...@deepbondi.net wrote: On Thu, 3 Jun 2010, Maciej Piechotka wrote: Hmm. Thanks - however I fail to figure out how to do something like: generate a random number with normal distribution with average avg and standard deviation stdev

[Haskell-cafe] Re: PDF generation?

2010-06-07 Thread Maciej Piechotka
On Tue, 2010-06-01 at 21:45 +0300, Yitzchak Gale wrote: I wrote: I have often generated PostScript from Haskell... Then you convert the PS to PDF using any of the nice utilities around for that Pierre-Etienne Meunier wrote: Isn't there a problem with non-type 1 vectorial fonts being

Re: [Haskell-cafe] Re: Difference between div and /

2010-06-03 Thread Maciej Piechotka
On Thu, 2010-06-03 at 12:44 +1200, Richard O'Keefe wrote: On Jun 3, 2010, at 1:13 AM, Maciej Piechotka wrote: On Wed, 2010-06-02 at 14:01 +1200, Richard O'Keefe wrote: For what applications is it useful to use the same symbol for operations obeying (or in the case of floating point

[Haskell-cafe] Re: Re: Difference between div and /

2010-06-03 Thread Maciej Piechotka
On Wed, 2010-06-02 at 16:11 +0200, Henning Thielemann wrote: Sorry, I missed this post. Maciej Piechotka schrieb: Well - i tried to write some package dealing with distributions etc. If you have something like that: instance ... = Distribution (Linear a) a where rand

[Haskell-cafe] Re: Difference between div and /

2010-06-02 Thread Maciej Piechotka
On Wed, 2010-06-02 at 14:01 +1200, Richard O'Keefe wrote: For what applications is it useful to use the same symbol for operations obeying (or in the case of floating point operations, *approximating* operations obeying) distinct laws? If the given operations do share something in common.

[Haskell-cafe] Difference between div and /

2010-06-01 Thread Maciej Piechotka
I started to wonder what is the difference between div and / so they are 2 separate symbols. div: Take a Integral divide and round (down) (/): Take a Fractional divide and usually round In some applications I would like to use any of those but it is not possible. Is this unification taken

Re: [Haskell-cafe] Difference between div and /

2010-06-01 Thread Maciej Piechotka
On Tue, 2010-06-01 at 22:40 +0200, Jonas Almström Duregård wrote: One might expect a == (a/b)*b and other common arithmetic formulas to hold for division? Better not if one's using Float or Double. I figured someone would say that :) What about this one: round (a/b/c) == round

Re: [Haskell-cafe] Difference between div and /

2010-06-01 Thread Maciej Piechotka
On Tue, 2010-06-01 at 15:20 -0400, Aaron D. Ball wrote: What does (stdin + stderr) `mod` stdout mean (result will be stdin). In my GHCi (6.12.1) with System.IO, this fails because Handle is not a numeric type. What implementation are you using? Ups. I missed the Handle with Fd. Which

[Haskell-cafe] Re: Difference between div and /

2010-06-01 Thread Maciej Piechotka
On Tue, 2010-06-01 at 15:29 -0700, Evan Laforge wrote: [1] By co I mean Ruby, Python, Perl and others. There are no so many languages that do recognize the difference. % python -Q new Python 2.4.6 (#1, Aug 3 2009, 17:05:16) [GCC 4.0.1 (Apple Inc. build 5490)] on darwin Type help,

Re: [Haskell-cafe] Re: Difference between div and /

2010-06-01 Thread Maciej Piechotka
On Wed, 2010-06-02 at 01:13 +0200, Daniel Fischer wrote: On Wednesday 02 June 2010 00:55:08, Maciej Piechotka wrote: On Tue, 2010-06-01 at 15:29 -0700, Evan Laforge wrote: [1] By co I mean Ruby, Python, Perl and others. There are no so many languages that do recognize the difference

[Haskell-cafe] Re: Math questions

2010-05-28 Thread Maciej Piechotka
On Tue, 2010-05-25 at 22:47 +0100, Mujtaba Boori wrote: Hello I am try to solve this equation Define a higher order function that tests whether two functions , both defined on integers , coincide for all integers between 1 and 100 how can I solve this ? is there any thing in

[Haskell-cafe] Re: Proof question -- (==) over Bool

2010-05-22 Thread Maciej Piechotka
On Sat, 2010-05-22 at 00:15 +, R J wrote: I'm trying to prove that (==) is reflexive, symmetric, and transitive over the Bools, given this definition: (==) :: Bool - Bool - Bool x == y = (x y) || (not x not y) My question is: are the

[Haskell-cafe] Type famillies Lifting IO

2010-05-19 Thread Maciej Piechotka
I started playing with type families. I wanted to achieve, for the beginning, something like: import qualified Control.Monad.IO.Class as IOC import Control.Monad.Trans.Class import Control.Monad.Trans.Cont import Data.Functor.Identity class (Monad m, Monad (IO' m)) = MonadIO m where

[Haskell-cafe] Re: What makes Haskell difficult as .NET?

2010-05-14 Thread Maciej Piechotka
On Fri, 2010-05-14 at 10:40 -0700, Daryoush Mehrtash wrote: In this presentation http://norfolk.cs.washington.edu/htbin-post/unrestricted/colloq/details.cgi?id=907 the speaker talks about F# on .Net platform. Early on in the talk he says that they did F# because haskell would be hard to

Re: [Haskell-cafe] Re: What makes Haskell difficult as .NET?

2010-05-14 Thread Maciej Piechotka
On Fri, 2010-05-14 at 22:54 -0400, C. McCann wrote: On Fri, May 14, 2010 at 8:39 PM, Maciej Piechotka uzytkown...@gmail.com wrote: 1. Haskell Class/Type famillies/... are conceptually different then classes and interfaces. I believe interfaces would be roughly equivalent to the subset

[Haskell-cafe] Re: Ideas of a polymorphic Tree in Haskell

2010-05-13 Thread Maciej Piechotka
On Thu, 2010-05-13 at 10:06 -0300, Edgar Z. Alvarenga wrote: Hi, I created a small Genetic Algorithm program, replicating this work (Statistical mechanics of program systems - JP Neirotti, N. Caticha, Journal of Physics A Math and Gen) made in Lisp. When a restricted the problem just for

[Haskell-cafe] Re: IO (Either a Error) question

2010-05-07 Thread Maciej Piechotka
On Fri, 2010-05-07 at 19:26 -0700, John Meacham wrote: On Fri, May 07, 2010 at 08:27:04PM -0400, Dan Doel wrote: Personally, I don't really understand why unfailable patterns were canned (they don't seem that complicated to me), so I'd vote to bring them back, and get rid of fail. But

[Haskell-cafe] Re: Re: Haskell and scripting

2010-05-06 Thread Maciej Piechotka
On Wed, 2010-05-05 at 17:18 -0400, Kyle Murphy wrote: Concerning your second point, I think just about any functional language isn't going to be simple or quick to learn. It's simply not a way of approaching problems that your average person (even your average programmer) is used to dealing

  1   2   3   >