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
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
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
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
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
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
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
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
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_.
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),
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 -
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
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
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
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
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
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
-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
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
-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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
. 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
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
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
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
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 -
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
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
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
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
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++...)
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
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
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
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
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:
.
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
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
: 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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
?
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
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:
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
= 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
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
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
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
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.
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
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 - 100 of 667 matches
Mail list logo