Re: [Haskell-cafe] starting GHC development -- two questions

2013-08-09 Thread Richard Eisenberg
On 2013-08-09 00:25, Ömer Sinan Ağacan wrote: Hello Edward, First off, welcome to the wonderful world of GHC development! I recommend that you subscribe to the ghc-devs mailing list and direct GHC specific questions there: http://www.haskell.org/mailman/listinfo/ghc-devs Thanks, I didn't know

[Haskell-cafe] starting GHC development -- two questions

2013-08-08 Thread Ömer Sinan Ağacan
Hi all, I want to start working on GHC, I cloned the repo, made some trivial changes(change some strings etc.) and re-built and observed the results. Now I'll continue reading and understanding the source. While doing this, I think one feature would greatly help me finding my way through GHC

Re: [Haskell-cafe] starting GHC development -- two questions

2013-08-08 Thread Edward Z. Yang
Hello Ömer, First off, welcome to the wonderful world of GHC development! I recommend that you subscribe to the ghc-devs mailing list and direct GHC specific questions there: http://www.haskell.org/mailman/listinfo/ghc-devs While doing this, I think one feature would greatly help me

Re: [Haskell-cafe] starting GHC development -- two questions

2013-08-08 Thread Ömer Sinan Ağacan
Hello Edward, First off, welcome to the wonderful world of GHC development! I recommend that you subscribe to the ghc-devs mailing list and direct GHC specific questions there: http://www.haskell.org/mailman/listinfo/ghc-devs Thanks, I didn't know that. I subscribed and I will ask

Re: [Haskell-cafe] some questions about Template Haskell

2013-07-02 Thread TP
John Lato wrote: Now, I have found another behavior difficult to understand for me: runQ $ lift u ListE [LitE (CharL 'u') runQ $ [| u |] LitE (StringL u) So we have similar behaviors for lift and [||]. We can check it in a splice: $( [| u |] ) u $( lift u ) u But if I replace

Re: [Haskell-cafe] some questions about Template Haskell

2013-07-02 Thread John Lato
lift and [| |] give similar results for that very stripped-down example, but it would be incorrect to extrapolate their behaviors from that case. They're executed at different times, by different mechanisms, and have vastly different behavior. It's also best to think of [| |] as having the type

Re: [Haskell-cafe] some questions about Template Haskell

2013-07-01 Thread TP
John Lato wrote: The problem isn't the output of nameBase, it's the input parameter 'n'. In your example, you've created a function that takes input (a Name) and generates code based upon that input. In order to lift a value (n) from an ordinary context into a quote, it needs a Lift

Re: [Haskell-cafe] some questions about Template Haskell

2013-07-01 Thread adam vogt
On Mon, Jul 1, 2013 at 5:42 PM, TP paratribulati...@free.fr wrote: So what is the difference between lift and [||]? Although I feel stupid, I cannot lie and claim I have understood. Hi TP, Sometimes [| |] does need to call lift. If for some reason the original lift wasn't exported, you could

Re: [Haskell-cafe] some questions about Template Haskell

2013-06-30 Thread oleg
TP wrote: pr :: Name - ExpQ pr n = [| putStrLn $ (nameBase n) ++ = ++ show $(varE n) |] The example is indeed problematic. Let's consider a simpler one: foo :: Int - ExpQ foo n = [|n + 1|] The function f, when applied to an Int (some bit pattern in a machine register), produces _code_.

Re: [Haskell-cafe] some questions about Template Haskell

2013-06-30 Thread TP
o...@okmij.org wrote: pr :: Name - ExpQ pr n = [| putStrLn $ (nameBase n) ++ = ++ show $(varE n) |] The example is indeed problematic. Let's consider a simpler one: foo :: Int - ExpQ foo n = [|n + 1|] The function f, when applied to an Int (some bit pattern in a machine register),

Re: [Haskell-cafe] some questions about Template Haskell

2013-06-30 Thread John Lato
On Mon, Jul 1, 2013 at 6:01 AM, TP paratribulati...@free.fr wrote: o...@okmij.org wrote: pr :: Name - ExpQ pr n = [| putStrLn $ (nameBase n) ++ = ++ show $(varE n) |] The example is indeed problematic. Let's consider a simpler one: foo :: Int - ExpQ foo n = [|n + 1|] The

Re: [Haskell-cafe] some questions about Template Haskell

2013-06-29 Thread TP
TP wrote: 2/ If I define in a module: j = 3 and then define in another module: --- h x = $([|j|]) main = do print $ h undefined --- I obtain 3 as expected. However, I do not achieve to make this system work with an infix declaration: infix

Re: [Haskell-cafe] some questions about Template Haskell

2013-06-29 Thread Richard Eisenberg
Hi TP, The reason that your initial example doesn't work is that Template Haskell splices can be used in four places: expressions, types, patterns (I think), and top-level declarations. The number in a fixity declaration is none of these. It's not an expression because you must write a literal

[Haskell-cafe] some questions about Template Haskell

2013-06-28 Thread TP
Hi everybody, I am trying to learn Template Haskell, and I have two independent questions. 1/ First, the following code (which is not in its final version, but it is a test) does not compile: --- {-# LANGUAGE TemplateHaskell #-} module Pr where import Language.Haskell.TH pr

Re: [Haskell-cafe] [repa] beginner questions

2012-11-19 Thread Dmitry Malikov
On 11/19/2012 01:21 AM, Dominic Steinitz wrote: Dmitry Malikov malikov.d.y at gmail.com writes: Playing around with repa arrays and got some questions. 1) How I can get list of indexes of array that suffice some predicate? a1 AUnboxed (Z :. 3) (fromList [False,False,True

Re: [Haskell-cafe] [repa] beginner questions

2012-11-18 Thread Dominic Steinitz
Dmitry Malikov malikov.d.y at gmail.com writes: Playing around with repa arrays and got some questions. 1) How I can get list of indexes of array that suffice some predicate? a1 AUnboxed (Z :. 3) (fromList [False,False,True]) it :: Array U (Z :. Int) Bool Indexes

[Haskell-cafe] [repa] beginner questions

2012-11-10 Thread Dmitry Malikov
Playing around with repa arrays and got some questions. 1) How I can get list of indexes of array that suffice some predicate? a1 AUnboxed (Z :. 3) (fromList [False,False,True]) it :: Array U (Z :. Int) Bool Indexes of element that satisfying specific predicate could be obtained

Re: [Haskell-cafe] vector-simd: some code available, and some questions

2012-07-08 Thread Gábor Lehel
On Sun, Jul 8, 2012 at 3:05 AM, Nicolas Trangez nico...@incubaid.com wrote: On Sun, 2012-07-08 at 01:40 +0200, Gábor Lehel wrote: unsafeXorSSE42 :: (Storable a, SV.AlignedToAtLeast SV.A16 o1, SV.Alignment o1, SV.AlignedToAtLeast SV.A16 o2, SV.Alignment o2, SV.AlignedToAtLeast

Re: [Haskell-cafe] vector-simd: some code available, and some questions

2012-07-08 Thread Reiner Pope
benchmark results at [3]. More about the benchmark at the end of this email. First some questions and requests for help: - I'm stuck with a typing issue related to 'sizeOf' calculation at [4]. I tried a couple of things, but wasn't able to figure out how to fix it. - I'm using

Re: [Haskell-cafe] vector-simd: some code available, and some questions

2012-07-08 Thread Nicolas Trangez
On Sun, 2012-07-08 at 20:49 +1000, Reiner Pope wrote: I've not been following this thread very closely, but it seems like what you're trying to do may be related to Geoffrey Mainland's work on SIMD support in GHC. See [1] for his SIMD-enabled version of the vector library. He's also written

Re: [Haskell-cafe] vector-simd: some code available, and some questions

2012-07-08 Thread Nicolas Trangez
On Sun, 2012-07-08 at 10:27 +0200, Gábor Lehel wrote: On Sun, Jul 8, 2012 at 3:05 AM, Nicolas Trangez nico...@incubaid.com wrote: I implemented the inductive alignment calculation over One and Twice (good idea, and easy to do), but I don't get the thing about superclasses. I've been trying

[Haskell-cafe] vector-simd: some code available, and some questions

2012-07-07 Thread Nicolas Trangez
All, After my message of yesterday [1] I got down to it and implemented something along those lines. I created a playground repository containing the code at [2]. Initial benchmark results at [3]. More about the benchmark at the end of this email. First some questions and requests for help

Re: [Haskell-cafe] vector-simd: some code available, and some questions

2012-07-07 Thread Gábor Lehel
On Sat, Jul 7, 2012 at 9:13 PM, Nicolas Trangez nico...@incubaid.com wrote: - Currently Alignment phantom types (e.g. A8 and A16) are not related to each other: a function (like Data.Vector.SIMD.Algorithms.unsafeXorSSE42) can have this signature: unsafeXorSSE42 :: Storable a = SV.Vector

Re: [Haskell-cafe] vector-simd: some code available, and some questions

2012-07-07 Thread Gábor Lehel
On Sat, Jul 7, 2012 at 9:59 PM, Gábor Lehel illiss...@gmail.com wrote: class AlignedToAtLeast n a instance AlignedToAtLeast A1 A1 instance AlignedToAtLeast A4 A1 instance AlignedToAtLeast A4 A4 instance AlignedToAtLeast A8 A1 instance AlignedToAtLeast A8 A4 instance AlignedToAtLeast A8 A8

Re: [Haskell-cafe] vector-simd: some code available, and some questions

2012-07-07 Thread Nicolas Trangez
On Sat, 2012-07-07 at 21:59 +0200, Gábor Lehel wrote: An alternative solution is to encode all of the alignments in unary, which is more general; if they're all going to be a power of two you can store just the logarithm: data One data Twice n -- not practical to call it Double :) class

Re: [Haskell-cafe] vector-simd: some code available, and some questions

2012-07-07 Thread Gábor Lehel
On Sun, Jul 8, 2012 at 12:21 AM, Nicolas Trangez nico...@incubaid.com wrote: On Sat, 2012-07-07 at 21:59 +0200, Gábor Lehel wrote: An alternative solution is to encode all of the alignments in unary, which is more general; if they're all going to be a power of two you can store just the

Re: [Haskell-cafe] vector-simd: some code available, and some questions

2012-07-07 Thread Nicolas Trangez
On Sat, 2012-07-07 at 21:13 +0200, Nicolas Trangez wrote: As you can see, the zipWith Data.Vector.SIMD implementation is slightly slower than the Data.Vector.Storable based one. I didn't perform much profiling yet, but I suspect allocation and ForeignPtr creation is to blame, this seems to be

Re: [Haskell-cafe] vector-simd: some code available, and some questions

2012-07-07 Thread Nicolas Trangez
On Sun, 2012-07-08 at 01:40 +0200, Gábor Lehel wrote: unsafeXorSSE42 :: (Storable a, SV.AlignedToAtLeast SV.A16 o1, SV.Alignment o1, SV.AlignedToAtLeast SV.A16 o2, SV.Alignment o2, SV.AlignedToAtLeast SV.A16 o3, SV.Alignment o3) = SV.Vector o1 a - SV.Vector o2 a -

[Haskell-cafe] Administrative questions about Haskell GSOC (Google Summer of Code)

2012-04-19 Thread Ryan Newton
proposals? If I can find the answers to these questions maybe I can update the Wiki for next year so it has a bit more info for mentors and about the process as well as students: http://hackage.haskell.org/trac/summer-of-code/wiki/Soc2012 Thank you, -Ryan

Re: [Haskell-cafe] Category Theory Questions

2012-04-09 Thread wren ng thornton
On 4/9/12 12:37 AM, Sergiu Ivanov wrote: I am currently studying category theory by the book Joy of Cats. Are there any people whom I could ask some questions related to category theory from time to time? Or could I just post my questions here directly? In addition to the math venues

Re: [Haskell-cafe] Category Theory Questions

2012-04-09 Thread Sergiu Ivanov
On Mon, Apr 9, 2012 at 9:47 AM, wren ng thornton w...@freegeek.org wrote: On 4/9/12 12:37 AM, Sergiu Ivanov wrote: I am currently studying category theory by the book Joy of Cats.  Are there any people whom I could ask some questions related to category theory from time to time?  Or could I

[Haskell-cafe] Category Theory Questions

2012-04-08 Thread Sergiu Ivanov
Hello, I have a question not that directly related to Haskell, but I still think this is a good place to ask it. I am currently studying category theory by the book Joy of Cats. Are there any people whom I could ask some questions related to category theory from time to time? Or could I just

Re: [Haskell-cafe] Category Theory Questions

2012-04-08 Thread dilawar rajput
I am not sure if this is a good forum to ask Category theory related questions as such. Some better options may be math.stackexchange.com or mathoverflow.net. Many category theory ideas are implemented in Haskell. So some discussion may have happened over here but surely its not a forum

Re: [Haskell-cafe] Category Theory Questions

2012-04-08 Thread Daniel Peebles
I doubt anyone will mind too much, but you probably want to stick to the category theory that is obviously applicable to Haskell (and ideally talk/ask about how it applies). Questions about initial algebras and Lambek's lemma will probably get decent responses, whereas globe categories

[Haskell-cafe] Questions on the Haskell 2010 report

2012-01-08 Thread Silvio Frischknecht
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I am trying to write a haskell compiler and i have stumbled upon 2 issues that i don't understand in the Haskell report 2010. Btw. these issues are also present in the 98 report. 1) first is this in section 5.1 Module Structure [1]. A module is

Re: [Haskell-cafe] Questions on the Haskell 2010 report

2012-01-08 Thread Brandon Allbery
On Sun, Jan 8, 2012 at 12:53, Silvio Frischknecht silvio.fris...@gmail.comwrote: module → module modid [exports] where body | body body→ { impdecls ; topdecls } | { impdecls } | { topdecls } You

Re: [Haskell-cafe] Questions on the Haskell 2010 report

2012-01-08 Thread Silvio Frischknecht
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks for the response Pardon? As I read the spec you quoted, the former agrees with it and the latter does not. How do you get the (illegal) latter? Oh, yes your right. I must have mixed up something. If you don't name a module, the module

Re: [Haskell-cafe] Three questions to graphviz

2011-10-11 Thread kaffeepause73
Hi Ivan, I already played around a fair bit with options in both cases, but there are quite a few so it gets quite worky with try and error. Going to graphviz directly doesn't seem a bad idea. Thanks Phil -- View this message in context: http://haskell.1045720.n5.nabble.com/Three-questions

Re: [Haskell-cafe] Three questions to graphviz

2011-10-11 Thread Ivan Lazar Miljenovic
On 11 October 2011 17:00, kaffeepause73 kaffeepaus...@yahoo.de wrote: Hi Ivan, I already played around a fair bit with options in both cases, but there are quite a few so it gets quite worky with try and error. Definitely. I've never bothered fully documenting

[Haskell-cafe] Three questions to graphviz

2011-10-10 Thread kaffeepause73
in the diagram, but my original graph data is coming directed ... Cheers Phil http://haskell.1045720.n5.nabble.com/file/n418/GraphA.jpg http://haskell.1045720.n5.nabble.com/file/n418/GraphC.jpg -- View this message in context: http://haskell.1045720.n5.nabble.com/Three-questions

Re: [Haskell-cafe] Three questions to graphviz

2011-10-10 Thread David Barbour
On Mon, Oct 10, 2011 at 9:44 AM, kaffeepause73 kaffeepaus...@yahoo.dewrote: First of all - thanks a lot for this package, graphviz is an awesome tool and having this interface library is really convenient. There a three point where I could use some help: 1. when I try to create a label with

Re: [Haskell-cafe] Three questions to graphviz

2011-10-10 Thread kaffeepause73
Hi Dave, Thanks for the quick reply - it works now. - I wasted quite a bit time on this. I guess the internal bit in the compiler message confused me. Cheers Phil -- View this message in context: http://haskell.1045720.n5.nabble.com/Three-questions-to-graphviz-tp418p4888946.html Sent from

Re: [Haskell-cafe] Three questions to graphviz

2011-10-10 Thread Ketil Malde
kaffeepause73 kaffeepaus...@yahoo.de writes: Thanks for the quick reply - it works now. - I wasted quite a bit time on this. Alternatively, you can turn on overloaded strings, which allows constructing text values (along with other types that are instances of IsString) from string constants.

Re: [Haskell-cafe] Three questions to graphviz

2011-10-10 Thread Ivan Lazar Miljenovic
On 11 October 2011 03:44, kaffeepause73 kaffeepaus...@yahoo.de wrote: First of all - thanks a lot for this package, graphviz is an awesome tool and having this interface library is really convenient. There a three point where I could use some help: 2. I know how to rotate the whole diagram

Re: [Haskell-cafe] Make shared library - questions

2011-08-28 Thread David Banas
I'm trying to compile shared library. This library will use as part of plugin for some program. If I compile library with option -dynamic my library has links for HS libraries like libHSbase-4.2.0.2-ghc6.12.3.so and so on. But program has crashed constantly. Is it possible to make shared

[Haskell-cafe] Make shared library - questions

2011-08-26 Thread Sergiy Nazarenko
Hi ! I'm trying to compile shared library. This library will use as part of plugin for some program. If I compile library with option -dynamic my library has links for HS libraries like libHSbase-4.2.0.2-ghc6.12.3.so and so on. But program has crashed constantly. Is it possible to make shared

Re: [Haskell-cafe] Make shared library - questions

2011-08-26 Thread Max Bolingbroke
On 26 August 2011 13:52, Sergiy Nazarenko nazarenko.ser...@gmail.com wrote: /usr/local/lib/ghc-6.12.3/base-4.2.0.2/libHSbase-4.2.0.2.a(Conc__270.o): relocation R_X86_64_32 against `base_GHCziConc_ensureIOManagerIsRunning1_closure' can not be used when making a shared object; recompile with

Re: [Haskell-cafe] QuickCheck Questions

2011-08-02 Thread Øystein Kolsrud
Hi! I usually use the function 'sized' for this. The function would look something like this: myIntGen :: Gen Int myIntGen = sized $ \n - choose (0,f n) where 'f' is a function that uses the size value to generate an upper value for your random range. I usually use ^2 or sqrt or something like

[Haskell-cafe] More QuickCheck Questions

2011-07-25 Thread Mark Spezzano
Hi all, I still don't understand exactly how the QuickCheck sized function is meant to work, and what it's useful for. Please explain! Also, I think that class CoArbitrary can help to generate random *functions *(as opposed to values; but tell me if I'm wrong) but I don't see how this could

Re: [Haskell-cafe] More QuickCheck Questions

2011-07-25 Thread Michael Orlitzky
On 07/25/11 06:01, Mark Spezzano wrote: Hi all, I still don't understand exactly how the QuickCheck sized function is meant to work, and what it's useful for. Please explain! Also, I think that class CoArbitrary can help to generate random *functions *(as opposed to values; but tell me if

Re: [Haskell-cafe] More QuickCheck Questions

2011-07-25 Thread Ivan Lazar Miljenovic
On 25 July 2011 20:01, Mark Spezzano mark.spezz...@chariot.net.au wrote: Hi all, I still don't understand exactly how the QuickCheck sized function is meant to work, and what it's useful for. Please explain! The size parameter indicates how large a value can be generated (e.g. how big an Int

Re: [Haskell-cafe] More QuickCheck Questions

2011-07-25 Thread Alexander Solla
On Mon, Jul 25, 2011 at 3:01 AM, Mark Spezzano mark.spezz...@chariot.net.au wrote: Also, I think that class CoArbitrary can help to generate random *functions *(as opposed to values; but tell me if I'm wrong) but I don't see how this could be useful. How would you test that a function with

[Haskell-cafe] QuickCheck Questions

2011-07-24 Thread Mark Spezzano
. For example Coarbitrary and shrink are a bit of a mystery to me. Any code examples for any of the above questions would help greatly. I've been stuck on this problem for hours. :) Cheers, Mark ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] QuickCheck Questions

2011-07-24 Thread Kevin Quick
On Sun, 24 Jul 2011 07:30:56 -0700, Mark Spezzano mark.spezz...@chariot.net.au wrote: Hi all, I would appreciate it if someone can point me in the right direction with the following problem. I'm deliberately implementing a naive Queues packages that uses finite lists as the underlying

Re: [Haskell-cafe] QuickCheck Questions

2011-07-24 Thread Mark Spezzano
Hi Kevin, Thanks for the response. The first part works well with minor modifications. Part 2 is still a bit vague to me. I basically want to clamp the Integers generated within the Queue to between 0 and some positive number. At present they're giving me numbers all over the place

Re: [Haskell-cafe] QuickCheck Questions

2011-07-24 Thread Ivan Lazar Miljenovic
On 25 July 2011 14:31, Mark Spezzano mark.spezz...@chariot.net.au wrote: Hi Kevin, Thanks for the response. The first part works well with minor modifications. Part 2 is still a bit vague to me. I basically want to clamp the Integers generated within the Queue to between 0 and some positive

Re: [Haskell-cafe] Text.CSV questions

2011-06-20 Thread Alejandro Serrano Mena
Maybe you can directly distinguish if the parser returned an error (Left) or not (Right), instead of using lefts and rights: import Text.CSV import Data.Either import System import Data.List main = do [inpFileName] - getArgs putStrLn (Parsing ++inpFileName++...) result -

Re: [Haskell-cafe] Text.CSV questions

2011-06-20 Thread Dmitri O.Kondratiev
On Mon, Jun 20, 2011 at 7:30 PM, Alejandro Serrano Mena trup...@gmail.comwrote: Maybe you can directly distinguish if the parser returned an error (Left) or not (Right), instead of using lefts and rights: import Text.CSV import Data.Either import System import Data.List main = do

[Haskell-cafe] Text.CSV questions

2011-06-17 Thread Dmitri O.Kondratiev
Hi, I try to parse csv file with Text.CSV, like this: import Text.CSV import System main = do [inpFileName] - getArgs putStrLn (Parsing ++inpFileName++...) let result = parseCSVFromFile inpFileName print result === As a result I get: No instance for (Show

Re: [Haskell-cafe] Text.CSV questions

2011-06-17 Thread Michael Snoyman
On Fri, Jun 17, 2011 at 12:00 PM, Dmitri O.Kondratiev doko...@gmail.com wrote: Hi, I try to parse csv file with Text.CSV, like this: import Text.CSV import System main = do [inpFileName] - getArgs putStrLn (Parsing ++inpFileName++...) let result = parseCSVFromFile

Re: [Haskell-cafe] Text.CSV questions

2011-06-17 Thread Vincent Hanquez
On 06/17/2011 10:00 AM, Dmitri O.Kondratiev wrote: Hi, I try to parse csv file with Text.CSV, like this: import Text.CSV import System main = do [inpFileName] - getArgs putStrLn (Parsing ++inpFileName++...) let result = parseCSVFromFile inpFileName print result === As a

Re: [Haskell-cafe] Text.CSV questions

2011-06-17 Thread Dmitri O.Kondratiev
On Fri, Jun 17, 2011 at 1:04 PM, Vincent Hanquez t...@snarc.org wrote: On 06/17/2011 10:00 AM, Dmitri O.Kondratiev wrote: Hi, I try to parse csv file with Text.CSV, like this: import Text.CSV import System main = do [inpFileName] - getArgs putStrLn (Parsing ++inpFileName++...)

Re: [Haskell-cafe] Questions on list administration

2011-03-08 Thread Ketil Malde
Karthick Gururaj karthick.guru...@gmail.com writes: You are not allowed to post to this mailing list, and your message has been automatically rejected. If you think that your messages are being rejected in error, contact the mailing list owner at haskell-cafe-ow...@haskell.org. As it says

[Haskell-cafe] Questions on list administration

2011-03-07 Thread Karthick Gururaj
describes the posting guidelines and other information. Very useful. I would have stuck to asking questions on the beginner's group if I had known earlier.. Can I ask a couple of changes be done to help others like me? a. In google groups - https://groups.google.com/group/haskell-cafe/about - add

[Haskell-cafe] questions about network.curl/ web client programming

2011-01-13 Thread Michael Litchard
I'm learning both haskell and web programming as I go here, this question entails both. I'm writing a screen scraping program, and I'm at the point where I need to send certain data in the header. My question is, is that what method_HEADER is for? If so, could I see an example? If not, how does

[Haskell-cafe] Fwd: Questions about lambda calculus

2010-11-10 Thread Patrick LeBoutillier
Hi all, Sorry for cross-posting this, but I didn't get anything on the beginners list so I thought I'd give it a try here. Thanks, Patrick -- Forwarded message -- From: Patrick LeBoutillier patrick.leboutill...@gmail.com Date: Thu, Nov 4, 2010 at 2:02 PM Subject: Questions

Re: [Haskell-cafe] Fwd: Questions about lambda calculus

2010-11-10 Thread Max Bolingbroke
On 10 November 2010 12:49, Patrick LeBoutillier patrick.leboutill...@gmail.com wrote: I'm a total newbie with respect to the lambda calculus. I tried (naively) to port these examples to Haskell to play a bit with them: [snip] You can give type signatures to your first definitions like this:

Re: [Haskell-cafe] Fwd: Questions about lambda calculus

2010-11-10 Thread Ryan Ingram
. Thanks, Patrick -- Forwarded message -- From: Patrick LeBoutillier patrick.leboutill...@gmail.com Date: Thu, Nov 4, 2010 at 2:02 PM Subject: Questions about lambda calculus To: beginners beginn...@haskell.org Hi all, I've been reading this article: http://perl.plover.com

Re: [Haskell-cafe] Fwd: Questions about lambda calculus

2010-11-10 Thread namekuseijin
On Wed, Nov 10, 2010 at 3:36 PM, Ryan Ingram ryani.s...@gmail.com wrote: Max has a good solution, but another solution is to embed an untyped lambda calculus into Haskell -- atom is just used for output during testing data U = Atom Int | F (U - U) instance Show U where   show (Atom s) = s

Re: [Haskell-cafe] Fwd: Questions about lambda calculus

2010-11-10 Thread Patrick LeBoutillier
: Thu, Nov 4, 2010 at 2:02 PM Subject: Questions about lambda calculus To: beginners beginn...@haskell.org Hi all, I've been reading this article: http://perl.plover.com/lambda/tpj.html in which the author talks about the lambda calculus and uses examples in Perl (here's a link directly

Re: [Haskell-cafe] Fwd: Questions about lambda calculus

2010-11-10 Thread wren ng thornton
On 11/10/10 9:18 AM, Max Bolingbroke wrote: On 10 November 2010 12:49, Patrick LeBoutillier wrote: I'm a total newbie with respect to the lambda calculus. I tried (naively) to port these examples to Haskell to play a bit with them: You can give type signatures to your first definitions like

[Haskell-cafe] Re: Haddock API and .haddock interface files questions

2010-10-30 Thread David Waern
2010/10/26 Claus Reinke claus.rei...@talk21.com: Some questions about Haddock usage: 1. Haddock executable and library are a single hackage package,   but GHC seems to include only the former (haddock does not   even appear as a hidden package anymore). Is that intended? Yes, I think that's

[Haskell-cafe] Haddock API and .haddock interface files questions

2010-10-26 Thread Claus Reinke
Some questions about Haddock usage: 1. Haddock executable and library are a single hackage package, but GHC seems to include only the former (haddock does not even appear as a hidden package anymore). Is that intended? 2. Naively, I'd expect Haddock processing to involve three stages

Re: [Haskell-cafe] a couple of cabal related questions

2010-10-13 Thread Neil Mitchell
I do this using a .ghci file. For Hoogle I have a file called Paths.hs with the module name Paths_hoogle and stub exports. I then have my .ghci file as: :load Main.hs Paths.hs Now Paths.hs will never interfere, or be picked up in ghc --make, because it has the wrong name - but is used in ghci.

Re: [Haskell-cafe] a couple of cabal related questions

2010-10-13 Thread Ivan Lazar Miljenovic
On 14 October 2010 05:58, Neil Mitchell ndmitch...@gmail.com wrote: I do this using a .ghci file. For Hoogle I have a file called Paths.hs with the module name Paths_hoogle and stub exports. I then have my .ghci file as: :load Main.hs Paths.hs Now Paths.hs will never interfere, or be picked

[Haskell-cafe] a couple of cabal related questions

2010-10-12 Thread Dmitry V'yal
Hello, recently I've cabalized my program and it brought some problems. First of all, I made use of 'import Paths_package name' functionality to get the path of installed data files. It works great, but now I can no longer run my program in ghci because this module is auto-generated by

Re: [Haskell-cafe] a couple of cabal related questions

2010-10-12 Thread Magnus Therning
On Tue, Oct 12, 2010 at 10:20, Dmitry V'yal akam...@gmail.com wrote: Hello, recently I've cabalized my program and it brought some problems. First of all, I made use of 'import Paths_package name' functionality to get the path of installed data files. It works great, but now I can no longer

Re: [Haskell-cafe] a couple of cabal related questions

2010-10-12 Thread Dmitry V'yal
On 12.10.2010 13:45, Magnus Therning wrote: On Tue, Oct 12, 2010 at 10:20, Dmitry V'yalakam...@gmail.com wrote: Hello, recently I've cabalized my program and it brought some problems. First of all, I made use of 'import Paths_package name' functionality to get the path of installed data

Re: [Haskell-cafe] a couple of cabal related questions

2010-10-12 Thread Magnus Therning
On Tue, Oct 12, 2010 at 15:34, Dmitry V'yal akam...@gmail.com wrote: On 12.10.2010 13:45, Magnus Therning wrote: On Tue, Oct 12, 2010 at 10:20, Dmitry V'yalakam...@gmail.com  wrote: Hello, recently I've cabalized my program and it brought some problems. First of all, I made use of 'import

Re: [Haskell-cafe] a couple of cabal related questions

2010-10-12 Thread Ivan Lazar Miljenovic
On 13 October 2010 02:00, Magnus Therning mag...@therning.org wrote: On Tue, Oct 12, 2010 at 15:34, Dmitry V'yal akam...@gmail.com wrote: By the way, the 'version' variable doesn't mentioned in Cabal user guide, or at least I missed it. Is it documented somewhere? I don't know, I think I

Re: [Haskell-cafe] a couple of cabal related questions

2010-10-12 Thread Antoine Latter
On Tue, Oct 12, 2010 at 10:41 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 13 October 2010 02:00, Magnus Therning mag...@therning.org wrote: On Tue, Oct 12, 2010 at 15:34, Dmitry V'yal akam...@gmail.com wrote: By the way, the 'version' variable doesn't mentioned in Cabal user

[Haskell-cafe] First questions!

2010-09-02 Thread Eoin C . Bairéad
Example 2 Prelude let fac n = if n == 0 then 1 else n * fac (n-1) How does it know to stop ? and why does fac 2.5 hang? thanks Eoin -- -- Eoin C. Bairéad Dublin, Ireland Áth Cliath, Éire ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] First questions!

2010-09-02 Thread Daniel Fischer
On Thursday 02 September 2010 14:49:12, Eoin C. Bairéad wrote: Example 2 Prelude let fac n = if n == 0 then 1 else n * fac (n-1) How does it know to stop ? It tests for n == 0. If that returns True, the recursion stops. and why does fac 2.5 hang? Because 2.5 is not an integer, so fac

Re: [Haskell-cafe] First questions!

2010-09-02 Thread Johan Tibell
Hi! 2010/9/2 Eoin C. Bairéad ebair...@gmail.com Example 2 Prelude let fac n = if n == 0 then 1 else n * fac (n-1) How does it know to stop ? When fac is called with n=0 it returns 1 and stops the recursion. and why does fac 2.5 hang? fac, as you defined it, is only defined for

Re: [Haskell-cafe] First questions!

2010-09-02 Thread Miguel Mitrofanov
02.09.2010 16:49, Eoin C. Bairéad пишет: Example 2 Prelude let fac n = if n == 0 then 1 else n * fac (n-1) How does it know to stop ? To stop what? It's not doing anything, it's just an equation. So fac is the least function which satisfies this equation - meaning that it's value would be

Re: [Haskell-cafe] First questions!

2010-09-02 Thread Andrew Coppin
Eoin C. Bairéad wrote: Example 2 Prelude let fac n = if n == 0 then 1 else n * fac (n-1) How does it know to stop ? Becuase you said if n == 0 then 1. In other words, if n is zero then return one and stop. Only if n does *not* equal zero does it recursively so n * fac (n-1). and why

[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 Ben
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    returnA - out + x Wow, that was simple. I guess I never

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] questions about Arrows

2010-08-31 Thread Ben
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 (rSum2) : module Foo where import Control.Arrow import

[Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread michael rice
?     firstName - getLine     putStrLn What's your last name?     lastName - getLine     let bigFirstName = map toUpper firstName     bigLastName = map toUpper lastName     putStrLn $ hey ++ bigFirstName ++ ++ bigLastName ++ , how are you? === Questions: 1

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Felipe Lessa
On Tue, Aug 10, 2010 at 1:40 PM, michael rice nowg...@yahoo.com wrote: 1) Is there an implicit *in* before the last line above? The (let ... in ...) construct is an expression, while the (let ...) inside 'do' is a statement. The (do ...) itself is an expression. See the report:

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Job Vranish
lastName putStrLn $ hey ++ bigFirstName ++ ++ bigLastName ++ , how are you? === Questions: 1) Is there an implicit *in* before the last line above? 2) Within a do in the IO monad (or any other monad), can a *let* do something like this? let x = do

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread michael rice
= do   gen - getStdGen   let code = genCode gen   putStrLn $ Code is ++ show code   putStrLn ... Michael --- On Tue, 8/10/10, Job Vranish job.vran...@gmail.com wrote: From: Job Vranish job.vran...@gmail.com Subject: Re: [Haskell-cafe] Couple of questions about *let* within *do* To: michael rice

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Tillmann Rendel
michael rice wrote: OK, then there's also an implicit *in* after the *let* in this code. If you want to understand let statements in terms of let ... in ... expressions, you can do the following transformation: do s1 s2 let x1 = e1 x2 = e2 s3 s4 becomes do

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Daniel Fischer
On Tuesday 10 August 2010 19:12:57, michael rice wrote: OK, then there's also an implicit *in* after the *let* in this code. Yes. do let x = foo bar baz is desugared to let x = foo in (bar baz) Must the implicit (or explicit) *in* actually use the calculated value(s)? No, and if

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Bill Atkins
The let's aren't really statements, they're just named expressions and are still subject to lazy evaluation. In: let x = putStrLn Name getLine putStrLn Welcome x The program will print: Welcome Name? and then prompt for input, even though the let comes first. And if you never ran the

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Felipe Lessa
On Tue, Aug 10, 2010 at 2:40 PM, Bill Atkins batkin...@gmail.com wrote: They're not really statements, they're just named expressions and are still subject to lazy evaluation. In:  let x = putStrLn Name getLine  putStrLn Welcome  x Yes, 'putStrLn name getLine' is an expression.

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread michael rice
   s6? Michael --- On Tue, 8/10/10, Tillmann Rendel ren...@mathematik.uni-marburg.de wrote: From: Tillmann Rendel ren...@mathematik.uni-marburg.de Subject: Re: [Haskell-cafe] Couple of questions about *let* within *do* To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date

Re: [Haskell-cafe] Couple of questions about *let* within *do*

2010-08-10 Thread Alex Stangl
On Tue, Aug 10, 2010 at 11:01:28AM -0700, michael rice wrote: Hi all, Then, do s1 s2 let x1 = e1 x2 = e2 s3 s4 let x3 = e3 x4 = e4 s5 s6 becomes do s1 s2 let x1 = e1 x2 = e2 in do s3

  1   2   3   4   5   6   7   >