michael rice nowg...@yahoo.com writes:
cf2 :: Rational - [Int]
cf2 a = let ai = floor a -- Doesn't this make ai an Int? -Michael
in
if a == (toRational ai)
then [ai]
else ai : cf2 (1 / (a - ai))
One thing that you could
When I looked at it a year ago or so, it was a return of one
constructor in a sum.
Looking at core, you can see several places where a function is called
and that function always returns the same constructor, so the case
analysis of the return value is not needed; it should be returned as
an
There is already a library for type level number, called typelevel.
It's nice because it uses decimal representation of numbers and can
handle numbers of reasonable size.
I use it in the LLVM bindings.
-- Lennart
On Mon, Mar 30, 2009 at 1:07 AM, spoon sp...@killersmurf.com wrote:
I've been
Hello,
I suppose Lennart is referring to type-level [1]. But type-level uses
functional dependencies, right?
There is also tfp [2], which uses type families. In general, how would you
say your work compares to these two?
Thanks,
Pedro
[1]
Peter Verswyvelen bugf...@gmail.com writes:
I don't think it is realistic to expect that for a project of medium to
large size that you work only with stable versions of modules (this would
exclude most packages on Hackage I guess).
I think you're putting too much into stable here. IMO,
Lennart,
| Unfortunately, GHC lacks certain optimizations to make efficient code
| when using CMonad,
| so instead of C speed you get low speed.
...
| When I looked at it a year ago or so, it was a return of one
| constructor in a sum.
| Looking at core, you can see several places where a
On 29 Mar 2009, at 22:26, Xiao-Yong Jin wrote:
Peter Verswyvelen bugf...@gmail.com writes:
Mmm, my email was indeed very unclear about my question.
A very simple example: suppose a development team is working on a
program.
This program consist of modules A and B. Each module has it's own
| When I looked at it a year ago or so, it was a return of one
| constructor in a sum.
| Looking at core, you can see several places where a function is called
| and that function always returns the same constructor, so the case
| analysis of the return value is not needed; it should be returned
2009/3/29 Johan Tibell johan.tib...@gmail.com:
foreign import CALLCONV unsafe send
c_send :: CInt - Ptr a - CSize - CInt - IO CInt
Compiling results in:
parse error on input `CALLCONV'
This is what we use in Takusen's Database.ODBC.OdbcFunctions.hsc:
#ifdef mingw32_HOST_OS
#let
On Mon, 30 Mar 2009 07:09:25 +0200, Benjamin L.Russell
dekudekup...@yahoo.com wrote:
This sounds entertaining, but according to the HaskellWiki entry for
GuiTV (see http://haskell.org/haskellwiki/GuiTV), wxHaskell ... can
be difficult to install.
Has this difficulty been resolved? I am
Nicolas Pouillard wrote:
Excerpts from Henning Thielemann's message of Sat Mar 28 21:49:33 +0100 2009:
On Sat, 28 Mar 2009, John Lato wrote:
From: Donn Cave d...@avvanta.com
I have never felt that I really understood that one.
Honestly, me neither, until recently. I'm only barely starting
I wonder if I could write some sort of chunked fold which basically
still produces the same amount of thunks but in a way so that the do not
go on the stack all at once for reduction and thus do not cause a stack
overflow. Kind of a tree.
Not without re-associating the applications of the
In Scurry, I select the CALLCONV on the CPP command line. This might be
better if it's the only place you need an #ifdef.
http://hackage.haskell.org/packages/archive/Scurry/0.0.3/Scurry.cabal
See the OS selection in the executable section:
executable scurry
[..]
if os(mingw32)
On Mon, Mar 30, 2009 at 8:33 AM, Ketil Malde ke...@malde.org wrote:
Do one thing, and do it well. File versioning and change history:
darcs. Dependency tracking and building: cabal.
Yes, that could actually work. I would just need some link between a cabal
version and Darcs version (I must
On Sun, Mar 29, 2009 at 11:16 AM, Lennart Augustsson
lenn...@augustsson.net wrote:
I've uploaded my CMonad package to Hackage. It allows you to write
Haskell code in a C style.
Nice!
A nice addition would be to output a C AST from language-c:
On Mar 30, 2009, at 3:30 PM, Bas van Dijk wrote:
On Sun, Mar 29, 2009 at 11:16 AM, Lennart Augustsson
lenn...@augustsson.net wrote:
I've uploaded my CMonad package to Hackage. It allows you to write
Haskell code in a C style.
Nice!
A nice addition would be to output a C AST from language-c:
My query was in response to an earlier post claiming that ai was a Rational,
which post he almost simultaneously said to ignore.
I've used GHC and like it better than Hugs, but the Fedora Linux package is
humongous and I'm only on dialup right now.
I'm still not sure what some of the error
Claus Reinke ha scritto:
But Claus was right, appendU is lazy; this seems to be the cause of
the problem.
appendU is strict, insertWith just doesn't force it (follow the source link
in the haddocks to see why).
Ok, I see.
But, IMHO, this should be clearly documented.
I have updated my test
Can I close this ticket as not being to do with uvector?
-- Don
manlio_perillo:
Claus Reinke ha scritto:
But Claus was right, appendU is lazy; this seems to be the cause of
the problem.
appendU is strict, insertWith just doesn't force it (follow the source link
in the haddocks to see
On Fri, 2009-03-27 at 21:16 -0700, Donn Cave wrote:
Quoth Henning Thielemann lemm...@henning-thielemann.de,
On Fri, 27 Mar 2009, Donn Cave wrote:
Quoth Jonathan Cast jonathancc...@fastmail.fm,
An `error' is any condition where the correct response is for the
programmer to change the
2009/3/30 michael rice nowg...@yahoo.com:
I'm still not sure what some of the error messages I was getting were about.
As I wrote the function I tried to be aware of what mixed mode operations
were kosher ala
This is a mistake, but understandable given your lispy background;
there aren't
First, BASIC, now C. What's next, Haskell? =)
-Edward Kmett
On Sun, Mar 29, 2009 at 5:16 AM, Lennart Augustsson
lenn...@augustsson.netwrote:
I've uploaded my CMonad package to Hackage. It allows you to write
Haskell code in a C style.
Unfortunately, GHC lacks certain optimizations to make
Don Stewart ha scritto:
Can I close this ticket as not being to do with uvector?
Yes, thanks; and sorry for the noise.
But it may be interesting to study this the example I have pasted:
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=3103
I find it a bit surprising that using appendU is
Lennart,
I think the major emphasis that John's library has is on doing things other
than numbers well in the type system, using the type family syntax to avoid
the proliferation of intermediary names that the fundep approach yields.
I think his type family approach for type-level monads for
Haskell not having 'polymorphic kinds'.
Is there a good description of why Haskell doesn't have polymorphic kinds?
2009/3/30 Edward Kmett ekm...@gmail.com
Lennart,
I think the major emphasis that John's library has is on doing things other
than numbers well in the type system, using the
John Van Enk wrote:
Haskell not having 'polymorphic kinds'.
Is there a good description of why Haskell doesn't have polymorphic kinds?
IANA expert but polymorphic kinds belong to a set of reasonably new
influences (e.g. from dependently typed programming languages and
generic
I think my brain just exploded.
On Mar 30, 2009, at 1:29 PM, Edward Kmett wrote:
First, BASIC, now C. What's next, Haskell? =)
-Edward Kmett
On Sun, Mar 29, 2009 at 5:16 AM, Lennart Augustsson lenn...@augustsson.net
wrote:
I've uploaded my CMonad package to Hackage. It allows you to
Duncan and I have thought about this too, exactly as you describe.
(Just !x)
=
(# tag#, x# #)
-- Don
lennart:
When I looked at it a year ago or so, it was a return of one
constructor in a sum.
Looking at core, you can see several places where a function is called
and that function
As it goes, it'd probably be Forth.
On 30 Mar 2009, at 21:29, Edward Kmett wrote:
First, BASIC, now C. What's next, Haskell? =)
-Edward Kmett
On Sun, Mar 29, 2009 at 5:16 AM, Lennart Augustsson lenn...@augustsson.net
wrote:
I've uploaded my CMonad package to Hackage. It allows you to
I suppose having a good description of what I'd like to do might help: I'd
like to be able to make an N-Tuple an instance of a type class.
class Foo a where
instance Foo (,) where
instance Foo (,,) where
The different kindedness of (,) and (,,) prevent this from
Sebastiaan Visser wrote:
Lennart, what is the next language DSL you are going to build?
Prolog? XSLT?
Declarative 3D scene construction? ;-)
(What? I can wish, can't I?)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Declarative 3D scene construction? ;-)
+1
On Mon, Mar 30, 2009 at 3:16 PM, Andrew Coppin
andrewcop...@btinternet.comwrote:
Sebastiaan Visser wrote:
Lennart, what is the next language DSL you are going to build?
Prolog? XSLT?
Declarative 3D scene construction? ;-)
(What? I can wish,
Hi,
my quest for data structures continues. Lately I came across Zippers.
Can anybody point be to some useful examples?
Günther
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Thats a bit farther down the rabbit hole than the concern in question,
though certainly related.
An example of what you could write with polymorphic kinds, inventing a
notation for polymorphic kind variables using 'x to denote a polymorphic
kind x, which could subtitute in for a kind k = * | **
On Sat, 2009-03-28 at 01:27 +0100, Henning Thielemann wrote:
Jonathan Cast schrieb:
i.e., that application's
file decoding result should be an Either type that anticipates that
the file encoding may be invalid.
This is pretty standard, I thought. Do people write Haskell file input
Maybe I'm just being blind here, but I don't see a monad transformer (or
even a monad) in the standard libraries for producing unique values.
Have I missed something?
Related, I don't see a monad for gradually consuming input. We've got
the Reader monad, but that appears to just give you
xmonad's state is represented as a zipper on nested lists.
The wikipedia article on zippers lists this and other examples.
gue.schmidt:
Hi,
my quest for data structures continues. Lately I came across Zippers.
Can anybody point be to some useful examples?
Günther
John Van Enk wrote:
Declarative 3D scene construction? ;-)
+1
On Mon, Mar 30, 2009 at 3:16 PM, Andrew Coppin
andrewcop...@btinternet.com mailto:andrewcop...@btinternet.com wrote:
Sebastiaan Visser wrote:
Lennart, what is the next language DSL you are going to build?
At Mon, 30 Mar 2009 20:29:14 +0100,
Andrew Coppin wrote:
Maybe I'm just being blind here, but I don't see a monad transformer (or
even a monad) in the standard libraries for producing unique values.
Have I missed something?
There is Data.Unique
On Mon, Mar 30, 2009 at 12:40 PM, Jeremy Shaw jer...@n-heptane.com wrote:
At Mon, 30 Mar 2009 20:29:14 +0100,
Andrew Coppin wrote:
Maybe I'm just being blind here, but I don't see a monad transformer (or
even a monad) in the standard libraries for producing unique values.
Have I missed
Thanks Don,
I followed some examples but have not yet seen anything that would show
me how, for instance, turn a nested Map like
Map Int (Map Int (Map String Double)
into a zipped version.
That is presuming of course that this use is feasible at all.
Günther
Don Stewart schrieb:
On Mon, 30 Mar 2009 21:21:14 +0200, Gü?nther Schmidt gue.schm...@web.de
wrote:
Hi,
my quest for data structures continues. Lately I came across Zippers.
Can anybody point be to some useful examples?
Günther
Searching for Haskell ziper leads to the following pages:
Well, there are a few approaches available.
On the supply front you have the MonadSupply and MonadUnique proposals from
the wiki:
http://www.haskell.org/haskellwiki/New_monads/MonadSupply
http://www.haskell.org/haskellwiki/New_monads/MonadUnique
and of course, the ability to roll your own using
Hi.
What is the suggested (if any) convention for inserting an interactive
session in the documentation?
Right know I'm doing (in random-shuffle package):
-- |Convert a sequence @(e1...en)@ to a complete binary tree.
--
-- @
-- System.Random.Shuffle buildTree ['a','b','c','d','e']
-- Node
Andrew Coppin wrote:
Maybe I'm just being blind here, but I don't see a monad transformer (or
even a monad) in the standard libraries for producing unique values.
Have I missed something?
http://haskell.org/haskellwiki/New_monads/MonadSupply
linked to from:
I wasn't questioning the utility of John's library.
But I saw him mentioning unary numbers and I think it's a mistake to
use those for anything practical involving even moderately sized
numbers.
I'd love to see a good type level programming library. There's a lot
of it out there, but it's never
I think Data.Unique is horrible and should be banned.
It encourages a global variable style of programming that will just
bite you in the end.
-- Lennart
On Mon, Mar 30, 2009 at 8:40 PM, Jeremy Shaw jer...@n-heptane.com wrote:
At Mon, 30 Mar 2009 20:29:14 +0100,
Andrew Coppin wrote:
Maybe
On Mon, Mar 30, 2009 at 3:54 PM, Lennart Augustsson
lenn...@augustsson.netwrote:
I wasn't questioning the utility of John's library. But I saw him
mentioning unary numbers and I think it's a mistake to
use those for anything practical involving even moderately sized
numbers.
Completely
If you want one to generate names inside of a compiler. Here is a
monad that is specialized to provide features useful for that. (like
keeping track of in scope bound names independently of new
names that arn't available for binding when renaming mutually recursive
bindings as a group). Feel free
Control.Concurrent.STM.TMVar's combine the best of MVars and TVars:
-Unlike TVars, they permit blocking/early retry when the TMVar is being used
by other process, so that complete processes are not retried at the end when
happens that the TVars have been modified in the meantime.
- Unlike MVars,
At Mon, 30 Mar 2009 20:57:02 +0100,
Lennart Augustsson wrote:
I think Data.Unique is horrible and should be banned.
It encourages a global variable style of programming that will just
bite you in the end.
Agreed. I'm ashamed I even mentioned it.
- jeremy
On Sun, 29 Mar 2009, Andrew Coppin wrote:
Ryan Ingram wrote:
Take a look at Data.Accessor on hackage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/data-accessor
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/data-accessor-template
So, to summarise, it provides a
On 30 Mar 2009, at 20:16, Andrew Coppin wrote:
Lennart, what is the next language DSL you are going to build?
Prolog? XSLT?
Declarative 3D scene construction? ;-)
The ICFP programming contest in year 2000 was to write a ray tracer
for a given declarative 3D scene construction language
Can somebody explain to me how
[$expr| 1 + 2 |]
is different from
($expr 1 + 2)
Other than a superficially different type signature, I'm not seeing what
the fundamental difference is...
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
I suppose having a good description of what I'd like to do might help: I'd
like to be able to make an N-Tuple an instance of a type class.
class Foo a where
instance Foo (,) where
instance Foo (,,) where
The different kindedness of (,) and (,,) prevent this from working.
Not that this
I hope Haskell prime will be a bit more first class when it comes to
records.
On Mon, Mar 30, 2009 at 11:14 PM, Henning Thielemann
lemm...@henning-thielemann.de wrote:
On Sun, 29 Mar 2009, Andrew Coppin wrote:
Ryan Ingram wrote:
Take a look at Data.Accessor on hackage:
On Mon, 30 Mar 2009, Simon Marlow wrote:
Nicolas Pouillard wrote:
By reading the documentation of 'hGetLine' [1] one can see that this
function
can throw only an EOF exception so why not give it a type like below?
hGetLine :: Handle - ErrorT EOF IO String
Since one will have to handle
On Sat, Mar 28, 2009 at 3:03 AM, Henning Thielemann
lemm...@henning-thielemann.de wrote:
What about using a custom list type, that has only one constructor like
(:), that is, a type for infinite lists?
You mean
Data.Stream?http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Stream
On Sun, 29 Mar 2009, John Lato wrote:
On Sat, Mar 28, 2009 at 9:49 PM, Henning Thielemann
lemm...@henning-thielemann.de wrote:
On Sat, 28 Mar 2009, John Lato wrote:
Honestly, me neither, until recently. I'm only barely starting to
understand it, and I do think there's a great deal of
Sorry, my reply got lost in a private mailbox. :-)
On Sat, 28 Mar 2009, Henning Thielemann wrote:
On Sat, 28 Mar 2009, Martijn van Steenbergen wrote:
Hi Henning,
Henning Thielemann wrote:
Thanks for working on that issue! The German translation is fine. I have
recently written a Wiki
Hello everyone,
I am writing to judge interest in a Summer of Code proposition: an XML
Schema[1] implementation, described as a possbile application here[2].
As both a tool and an inspiration, I intend to use HaXML[3].
More specifically, I would be interested in the degree the Haskell
community
With some more context:
foo = ($expr 1 + 2)
v.
bar = [$expr| 1 + 2]
In the first example (assuming TH is enabled), $expr is a splice, which happens
at compile time. 'expr' is some value of type Q Exp (the AST for a Haskell
expression, in the quotation monad). The application of $expr to
2009/3/30 Don Stewart d...@galois.com:
Duncan and I have thought about this too, exactly as you describe.
(Just !x)
=
(# tag#, x# #)
It would be nice to generalize this to arbitrary sum types, but doing
so plays hell with the type checker - I think the most straightforward
way would
Thanks for the information.
Michael
--- On Mon, 3/30/09, Ryan Ingram ryani.s...@gmail.com wrote:
From: Ryan Ingram ryani.s...@gmail.com
Subject: Re: [Haskell-cafe] Rational and % operator remix
To: michael rice nowg...@yahoo.com
Cc: Ketil Malde ke...@malde.org, haskell-cafe@haskell.org
Date:
Hi all,
I am reading the book The lambda calculus: Its syntax and Semantics in the
chapter about Godel Numbering but I am confused in some points.
We know for Church Numerals, we have Cn = \fx.f^n(x) for some n=0,
i.e. C0= \fx.x and C
1 = \fx.fx.
From the above definition, I could guess the
Is it possible to rewrite this without unsafeIOToSTM? unsafeIOToSTM
is insanely unsafe, and can cause otherwise working STM code to do
unpredictable and terrible things to the runtime.
Cheers,
Sterl.
On Mar 30, 2009, at 4:27 PM, Alberto G. Corona wrote:
Control.Concurrent.STM.TMVar's
On the other hand, I find its use in Control.Timeout to be perfectly
sane (or at least as sane as anything else in that particular library).
Cheers,
Sterl.
On Mar 30, 2009, at 4:42 PM, Jeremy Shaw wrote:
At Mon, 30 Mar 2009 20:57:02 +0100,
Lennart Augustsson wrote:
I think Data.Unique is
On Mon, Mar 30, 2009 at 5:16 PM, Vlad Dogaru ddv...@anaconda.cs.pub.ro wrote:
* a translator from XML Schema to Haskell, similar to DtdToHaskell[4]
For the latter item, some runtime checking will definitely be required:
restrictions such as value ranges for integers or minimum and maximum
consider the following types (from the paper:
Stream Fusion From Lists to Streams to Nothing at All)
data Stream a = forall s. Stream ( s -(Step a s)) s
data Step a s =
Done
| Yield a s
| Skip s
an instance of this data type is:
stream0 :: Stream ()
stream0 = Stream (\ s - Yield ()
I can't tell exactly what you're asking, but I'll give it a try! :)
primes :: [Integer]
primes = [2,3,5,7,11,13,17,19,23,29,31,undefined]
godel :: String - Integer
godel = product . zipWith (^) primes . map (toInteger . ord)
-- Here is the identity function (note that double backslash is a
G'day all.
Quoting Lennart Augustsson lenn...@augustsson.net:
I think Data.Unique is horrible and should be banned.
It encourages a global variable style of programming that will just
bite you in the end.
In the sense that it doesn't give you anything that Monad.Supply
or
Hi,
a new version of the HTTP package - 4000.0.5 has been uploaded,
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP
Includes a bunch of fixes and cleanups (thanks to all that have
reportedcontributed), along with some (shock, horror) API documentation.
Let me know if it
Sebastiaan Visser wrote:
A nice addition would be to output a C AST from language-c:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/language-c
And compile and link that back into your program!
Nice toys indeed.
Lennart, what is the next language DSL you are going to build?
Prolog?
2009/03/30 Edward Kmett ekm...@gmail.com:
The main issue with generalizing consumption of input is what
does it entail? when you are parsing a list do you have one
element at a time consumption? or do you have the ability to
grab a whole prefix at once? These issues tend to push you
towards
I am pleased to announce the release of vacuum, a
Haskellhttp://haskell.org/library for extracting graph
representations of values from the GHC http://haskell.org/ghc/ heap, which
may then be further processed and/or
translated to Graphviz http://graphviz.org/ dot format to be visualized.
The
I am pleased to announce the release of vacuum, a library for extracting
graph representations of values from the GHC heap, which may then be further
processed and/or translated to Graphviz dot format to be visualized.
The package website is at http://moonpatio.com/vacuum/ , which contains a
I am pleased to announce the release of vacuum-cairo, a Haskell library
for interactive rendering and display of values on the GHC heap using
Matt Morrow's vacuum library.
This library takes vacuum's output, generates dot graph format from it,
renders it to SVG with graphviz, and displays the
77 matches
Mail list logo