Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread ajb
G'day all. Quoting aditya siram : I'm a little confused about this too. I've seen many functions defined like: f x = (\s -> ...) which is a partial function because it returns a function and is the same as: f x s = ... Off the top of my head the State monad makes extensive use if this style. I

Re: [Haskell-cafe] are forkIO threads event-driven?

2010-05-02 Thread Johan Tibell
On Mon, May 3, 2010 at 1:42 AM, John Lask wrote: > Re event library and merge into haskell base: has any thought gone into the > "windows" version of the library. Last I looked it was very unix centric - > the windows api is very different. I believe it will require major rework to > abstract the

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Sebastian Fischer
On May 3, 2010, at 6:35 AM, Alexander Dunlap wrote: Of course, there are situations where it is really awkward to not use partial functions, basically because you *know* that an invariant is satisfied That falls under Don's: "Use types to encode the design into a machine checkable form" O

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Ivan Miljenovic
On 3 May 2010 14:35, Alexander Dunlap wrote: > Of course, there are situations where it is really awkward to not use > partial functions, basically because you *know* that an invariant is > satisfied and there is no sane course of action if it isn't. True, like "map head . group". -- Ivan Lazar

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Alexander Dunlap
On Sun, May 2, 2010 at 9:24 PM, Ivan Miljenovic wrote: > On 3 May 2010 14:17, aditya siram wrote: >> I'm a little confused about this too. I've seen many functions defined like: >> f x = (\s -> ...) >> which is a partial function because it returns a function and is the same as: >> f x s = ... >

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread aditya siram
I missed the part where you talked about -Wall. Sorry. On 5/3/10, aditya siram wrote: > Cool. That makes way more sense. > > I thought that ghc -Wall picked these up. So at least this problem > would go away if warnings were turned on (and heeded) by default. > > Besides that from my own experien

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread aditya siram
Cool. That makes way more sense. I thought that ghc -Wall picked these up. So at least this problem would go away if warnings were turned on (and heeded) by default. Besides that from my own experience I'd strongly encourage people to use HLint [1] . -deech [1 ] http://hackage.haskell.org/packa

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Ivan Miljenovic
On 3 May 2010 14:17, aditya siram wrote: > I'm a little confused about this too. I've seen many functions defined like: > f x = (\s -> ...) > which is a partial function because it returns a function and is the same as: > f x s = ... No, that's a partially applied function. A partial function is

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread aditya siram
I'm a little confused about this too. I've seen many functions defined like: f x = (\s -> ...) which is a partial function because it returns a function and is the same as: f x s = ... Off the top of my head the State monad makes extensive use if this style. Is this bad? - deech On 5/2/10, B

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Bradford Larsen
On Sun, May 2, 2010 at 9:18 PM, Edgar Z. Alvarenga wrote: > On Sun, 02/May/2010 at 13:10 -0700, Don Stewart wrote: > >>     * Avoid partial functions > > Why? > > Edgar Ever place you use a partial function, you need to verify that its usage is in fact safe. Otherwise, you risk pattern match fai

[Haskell-cafe] Leibniz equality can be made injective

2010-05-02 Thread oleg
We show that type families let us write Leibniz equality witnesses of the injectivity of type constructors. We may use Leibniz equality not only for introduction but also for elimination. The paper on ``Typing Dynamic Typing'' (Baars and Swierstra, ICFP 2002) demonstrated the first implementation

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Ivan Miljenovic
On 3 May 2010 11:18, Edgar Z. Alvarenga wrote: > On Sun, 02/May/2010 at 13:10 -0700, Don Stewart wrote: > >>     * Avoid partial functions > > Why? What does "head []" do again? -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com _

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Conor McBride
On 3 May 2010, at 02:18, Edgar Z. Alvarenga wrote: On Sun, 02/May/2010 at 13:10 -0700, Don Stewart wrote: * Avoid partial functions Why? Tell you tomorrow. Conor ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Edgar Z. Alvarenga
On Sun, 02/May/2010 at 13:10 -0700, Don Stewart wrote: > * Avoid partial functions Why? Edgar ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Daniel Fischer
On Montag 03 Mai 2010 02:34:51, Ivan Miljenovic wrote: > This is on my ubuntu box at uni: > > iv...@feitpc02 ~ $export DUMMY="~/bin:~/cabal" You put quotes around the string, that means tildes aren't expanded ($VARIABLEs still are: da...@linux-mkk1:~/Haskell> export DUMMY="~/bin:~/.cabal:$HOME/.

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Ivan Miljenovic
On 3 May 2010 10:37, Brandon S. Allbery KF8NH wrote: > On May 2, 2010, at 20:34 , Ivan Miljenovic wrote: >> >> iv...@feitpc02 ~ $export DUMMY="~/bin:~/cabal" > > All bets are off when it's quoted; no shell tilde-expands quoted strings. Oh, in that case without the quotes it works (I thought it ha

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Brandon S. Allbery KF8NH
On May 2, 2010, at 20:34 , Ivan Miljenovic wrote: iv...@feitpc02 ~ $export DUMMY="~/bin:~/cabal" All bets are off when it's quoted; no shell tilde-expands quoted strings. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too ma

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Ivan Miljenovic
On 3 May 2010 10:25, Daniel Fischer wrote: > It is by my bash: > > da...@linux-mkk1:~/Haskell> export DUMMY=~/bin:~/.cabal > da...@linux-mkk1:~/Haskell> echo $DUMMY > /home/dafis/bin:/home/dafis/.cabal > da...@linux-mkk1:~/Haskell> printenv DUMMY > /home/dafis/bin:/home/dafis/.cabal > da...@linux-

[Haskell-cafe] Re: LLVM backend building segfault (Louis Wasserman)

2010-05-02 Thread Jonathan Fischoff
gfaults. Segfaults make me unhappy. Halp plz? > > Louis Wasserman > wasserman.lo...@gmail.com > http://profiles.google.com/wasserman.louis > -- next part -- > An HTML attachment was scrubbed... > URL: > http://www.haskell.org/pipermail/haskell-cafe/attachments/20100502/9c1c7db3/attachment-0001.html > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] are forkIO threads event-driven?

2010-05-02 Thread John Lask
As I said, it is very unix centric. The backend methods rely upon file descriptors which in the windows world are specific to the C rts. It is the backend that requires the abstraction from os specific structures/handling. The event library has a pluggable interface, with multiple backends, a

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Daniel Fischer
On Montag 03 Mai 2010 02:12:20, Ivan Miljenovic wrote: > On 3 May 2010 08:49, Daniel Fischer wrote: > > Am Montag 03 Mai 2010 00:28:31 schrieb Ivan Lazar Miljenovic: > >> bash expands it when you use it within bash, but when it's used > >> within another program this might not be the case (since t

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Ivan Miljenovic
On 3 May 2010 08:49, Daniel Fischer wrote: > Am Montag 03 Mai 2010 00:28:31 schrieb Ivan Lazar Miljenovic: >> bash expands it when you use it within bash, but when it's used within >> another program this might not be the case (since the PATH is just a >> String after all). > > But does that strin

Re: [Haskell-cafe] are forkIO threads event-driven?

2010-05-02 Thread Don Stewart
The event library has a pluggable interface, with multiple backends, and is entirely portable as a result. You just swap in your 'select' mechanism: http://github.com/tibbe/event/blob/master/src/System/Event/EPoll.hsc http://github.com/tibbe/event/blob/master/src/System/Event/Poll.hsc

Re: [Haskell-cafe] are forkIO threads event-driven?

2010-05-02 Thread John Lask
Re event library and merge into haskell base: has any thought gone into the "windows" version of the library. Last I looked it was very unix centric - the windows api is very different. I believe it will require major rework to abstract the commonalities and deal efficiently with the difference

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Brandon S. Allbery KF8NH
On May 2, 2010, at 18:21 , Daniel Fischer wrote: Additionally, some shells only expand "~" at the beginning of a "word", so if you `export PATH=~/foo:~/bar' the second "~" won't be expanded. (bash will expand it after a colon, so that should work.) Do you perchance know which shells would expa

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Daniel Fischer
Am Montag 03 Mai 2010 00:28:31 schrieb Ivan Lazar Miljenovic: > Daniel Fischer writes: > > > > If the default shell is bash and the PATH is set and exported in > > ~/.bashrc, it should work with '~' unless the string is quoted, > > shouldn't it? bash expands the tildes when the value is assigned t

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Ivan Lazar Miljenovic
Daniel Fischer writes: > Am Sonntag 02 Mai 2010 22:26:43 schrieb Brandon S. Allbery KF8NH: >> On May 2, 2010, at 05:33 , Limestraël wrote: >> > Yes, it's weird, but it works! Thanks. >> >> It's normal, actually. "~" is only understood by the shell, so unless >> the shell is invoked to expand it a

Re: [Haskell-cafe] Re: FRP for game programming / artifical life simulation

2010-05-02 Thread Ben
hello -- i'm putting the finishing touches on a cabal package based on what felipe gave, i've managed to make it an arrow transformer which is nice. i have a few issues though. 1) i know it is not possible to add class constraints on an existential type when declaring instances, but how do you g

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Daniel Fischer
Am Sonntag 02 Mai 2010 22:26:43 schrieb Brandon S. Allbery KF8NH: > On May 2, 2010, at 05:33 , Limestraël wrote: > > Yes, it's weird, but it works! Thanks. > > It's normal, actually. "~" is only understood by the shell, so unless > the shell is invoked to expand it a program will fail to understan

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Don Stewart
brad.larsen: > On Sun, May 2, 2010 at 4:10 PM, Don Stewart wrote: > > I don't believe anyone has written a "Programming Haskell in the Large" > > book (or any other similar functional language??), but there is lots of > > experience in this community working on big, long lived code bases. > > > >

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Bradford Larsen
On Sun, May 2, 2010 at 4:10 PM, Don Stewart wrote: > I don't believe anyone has written a "Programming Haskell in the Large" > book (or any other similar functional language??), but there is lots of > experience in this community working on big, long lived code bases. > > Some key points: [...] >

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Brandon S. Allbery KF8NH
On May 2, 2010, at 05:33 , Limestraël wrote: Yes, it's weird, but it works! Thanks. It's normal, actually. "~" is only understood by the shell, so unless the shell is invoked to expand it a program will fail to understand it. Additionally, some shells only expand "~" at the beginning of

Re: [Haskell-cafe] Problems with HStringTemplate UTF8 templates in ghc-6.12

2010-05-02 Thread Dmitry Simonchik
My system locale is en_US.UTF-8 I've written an example app as following import Text.StringTemplate(render, directoryGroupRecursive, STGroup, getStringTemplate, setAttribute) import qualified Data.ByteString as BS main :: IO () main = do tg <- getTemplates "./" let (Just tmpl) = getStrin

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Don Stewart
jaco.van.iterson: > Hi > > I was just wondering what methods are best to design/model the software in > bigger projects when you are planning to use Haskell. > Is there no difference compared to other languages? Are there any Haskell > tools? > I don't believe anyone has written a "Programming H

Re: [Haskell-cafe] are forkIO threads event-driven?

2010-05-02 Thread Johan Tibell
On Sun, May 2, 2010 at 8:45 PM, Aran Donohue wrote: > That's very interesting. I only brought it up because I'm thinking about > the upcoming problems of real-time web application servers. > > I'm sure many people have seen this blog post and Dons's replies: > > http://www.codexon.com/posts/debun

[Haskell-cafe] Haskell and the Software design process

2010-05-02 Thread Jaco van Iterson
Hi I was just wondering what methods are best to design/model the software in bigger projects when you are planning to use Haskell. Is there no difference compared to other languages? Are there any Haskell tools? Cheers, Jaco PS. "Software design in Haskell" didn't give relevant hits. :( __

Re: [Haskell-cafe] are forkIO threads event-driven?

2010-05-02 Thread Don Stewart
aran.donohue: > That's very interesting. I only brought it up because I'm thinking about the > upcoming problems of real-time web application servers. > > I'm sure many people have seen this blog post and Dons's replies: > http://www.codexon.com/posts/debunking-the-erlang-and-haskell-hype-for-ser

Re: [Haskell-cafe] are forkIO threads event-driven?

2010-05-02 Thread Aran Donohue
That's very interesting. I only brought it up because I'm thinking about the upcoming problems of real-time web application servers. I'm sure many people have seen this blog post and Dons's replies: http://www.codexon.com/posts/debunking-the-erlang-and-haskell-hype-for-servers

[Haskell-cafe] LLVM backend building segfault

2010-05-02 Thread Louis Wasserman
Hokay, so I've installed LLVM 2.7, gotten ghc-HEAD-2009-10-23-ghc-corelibs.tar.bz2, run ./darcs-all pull -a, run ./boot, applied add-new-llvm-code-generator-to-ghc_.dpatch ghc-llvmbackend-20100328.dpatch and written the following in mk/build.mk: GhcWithLlvmCodeGen = YES GhcEnableTablesNextToCode

Re: [Haskell-cafe] Problems with HStringTemplate UTF8 templates in ghc-6.12

2010-05-02 Thread Ivan Lazar Miljenovic
Dmitry Simonchik writes: > But recently I upgraded to ghc-6.12 and hstringtemplate-0.6.2 and the output > of my program now broken. I can see correctly only UTF8 values that I pass > to template from database. It seems that toString method produces not UTF-8 > encoded string, because if i use Code

[Haskell-cafe] Problems with HStringTemplate UTF8 templates in ghc-6.12

2010-05-02 Thread Dmitry Simonchik
Hi all, I need your help I have something i can't understand with hstringtemplate. I'm using this library in my project to render UTF-8 encoded templates. Everything was fine when I were using ghc-6.10 and hstringtemplate-0.6.1 But recently I upgraded to ghc-6.12 and hstringtemplate-0.6.2 and the

Re: [Haskell-cafe] MonadPlus or Alternative or ...?

2010-05-02 Thread Sebastian Fischer
would you have any suggestions on a name for such a class or names for the methods? I'm afraid I don't. I'd like class Pointed t where point :: a -> t a class Monoid m where id :: m (.) :: m -> m -> m constraint Monoidy t = (Pointed t, Monoid (t a)) (although

Re: [Haskell-cafe] MonadPlus or Alternative or ...?

2010-05-02 Thread Sean Leather
On Sun, May 2, 2010 at 12:07, Sebastian Fischer wrote: > > On May 2, 2010, at 11:10 AM, Sean Leather wrote: > > Or should I make my own class? >> >> Then, there obviously won't be any instances for existing types other than >> your own (which might be a good or bad thing). You may want to do this

Re: [Haskell-cafe] MonadPlus or Alternative or ...?

2010-05-02 Thread Sebastian Fischer
On May 2, 2010, at 11:10 AM, Sean Leather wrote: Or should I make my own class? Then, there obviously won't be any instances for existing types other than your own (which might be a good or bad thing). You may want to do this, if you don't want to require either (>>=) or (<*>), which ma

Re: [Haskell-cafe] Happy: PATH issue

2010-05-02 Thread Limestraël
Yes, it's weird, but it works! Thanks. 2010/5/1 Daniel Fischer > Am Samstag 01 Mai 2010 13:16:55 schrieb Limestraël: > > Hello Café, > > > > When I was trying to cabal-install haskell-src, I came up with: > > cabal: The program happy is required but it could not be found > > > > However, the ha

[Haskell-cafe] WGP 2010 Second Call for Papers (Apologies for multiple copies)

2010-05-02 Thread Bruno Oliveira
== CALL FOR PAPERS WGP 2010 6th ACM SIGPLAN Workshop on Generic Programming Baltimore, Maryland, US Sunday, Septembe

Re: [Haskell-cafe] MonadPlus or Alternative or ...?

2010-05-02 Thread Sean Leather
On Sun, May 2, 2010 at 10:23, Sebastian Fischer wrote: > > On May 2, 2010, at 1:11 AM, Sean Leather wrote: > > I want to generalize a set of functions from lists to some functor type. >> [...] Should I choose MonadPlus and use these? [...] Or should I choose >> Alternative and use these? [...] >>

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

2010-05-02 Thread Miguel Mitrofanov
ErrorT :: IO (Either Error String) -> ErrorT Error IO String I can think that can be written as ErrorT :: IO (Either Error String) -> ErrorT Error (IO String) Am I correct? No, you're not. Similar to function application, type application is also left-associative, so it can (but shouldn't)

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

2010-05-02 Thread Eugene Dzhurinsky
On Sat, May 01, 2010 at 02:42:26PM -0700, Ryan Ingram wrote: > Check out ErrorT in Control.Monad.Error > > > :t ErrorT > ErrorT :: m (Either e a) -> ErrorT e m a At this point I am lost. I'm not sure that I do understand this type transformation correctly. So we have some sort of monadic type m,

Re: [Haskell-cafe] MonadPlus or Alternative or ...?

2010-05-02 Thread Sebastian Fischer
On May 2, 2010, at 1:11 AM, Sean Leather wrote: I want to generalize a set of functions from lists to some functor type. [...] Should I choose MonadPlus and use these? [...] Or should I choose Alternative and use these? [...] There are some types that can be an instance of Alternative but