Sorry, I forgot to actually include the link to the source:
http://lowlymath.net/Iso.hs
/Joe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
I don't have an answer to your question, but I asked a similar one a while
ago:http://www.mail-archive.com/haskell-cafe@haskell.org/msg53872.html
http://www.mail-archive.com/haskell-cafe@haskell.org/msg53872.htmlRyan
Ingram gave an answer:
On 2009-10-01 18:47 +0200 (Thu), Alberto G. Corona wrote:
May be because consciousness is relatively new and thus, not optimized.
Actually, no; our brains are very, very highly optimized. Only they're
optimized for minimum power usage, not making the best decisions.
For more information, see
Hello Ross,
Wednesday, October 7, 2009, 6:02:28 AM, you wrote:
car = head
unfortunately it doesn't work without -fno-monomorphism-restriction
--
Best regards,
Bulatmailto:bulat.zigans...@gmail.com
___
Haskell-Cafe
On Wed, Oct 7, 2009 at 1:26 AM, Bulat Ziganshin
bulat.zigans...@gmail.com wrote:
Hello Ross,
Wednesday, October 7, 2009, 6:02:28 AM, you wrote:
car = head
unfortunately it doesn't work without -fno-monomorphism-restriction
It should be fine without the monomorphism restriction. Said
Hello Luke,
Wednesday, October 7, 2009, 11:35:47 AM, you wrote:
car = head
unfortunately it doesn't work without -fno-monomorphism-restriction
It should be fine without the monomorphism restriction. Said
restriction only applies to functions with typeclass constraints, of
which this has
--- BEGIN NOSTALGIA ---
Well, I have to add to this, that when I coded my first games in assembler
in the eighties, I did exactly the same thing: just recording the input of
the joystick was enough to get full replays and make auto playing demos.
But on the old computers, this was all so easy,
On Wed, Oct 7, 2009 at 10:05 AM, Peter Verswyvelen bugf...@gmail.com wrote:
over every bit of the system (it was even easy to count exactly how many
cycles a routine would take :-), so it was just a matter of starting the
You sound like you used to code on the Commodore 64 :)
David.
Peter Verswyvelen bugf...@gmail.com writes:
So yes, without using IO, Haskell forces you into this safe spot
One could argue that IO should be broken down into a set of sub-monads
encapsulating various subsets of the functionality - file system,
network access, randomness, and so on. This
Or you can use an effect system (however that doesn't give you the
opportunity of overriding IO functions, but I think that providing
such an opportunity with the means you suggest (splitting IO into many
sub-monads) is not going to be usable in the large scale)
By the way, I am surprised that
On Tue, 2009-10-06 at 13:22 -0700, Michael P Mossey wrote:
Duncan Coutts wrote:
So you end up with pure functions like:
shuffle :: RandomGen g = g - [x] - [x]
Thanks for the help, Duncan. I'm confused on one point. Don't you always need
the new state of the generator back? So
Yep. Commodore 64, Amiga. I really loved those machined, especially the
Amiga (mmm, maybe someone should port a Haskell compiler to the Amiga. ha,
how nerdy can one get? ;-)
On Wed, Oct 7, 2009 at 10:50 AM, David Virebayre
dav.vire+hask...@gmail.comdav.vire%2bhask...@gmail.com
wrote:
On Wed,
On Wed, Oct 7, 2009 at 11:13 AM, Ketil Malde ke...@malde.org wrote:
One could argue that IO should be broken down into a set of sub-monads
encapsulating various subsets of the functionality - file system,
network access, randomness, and so on. This could extend the safe
spot to cover much
Hi Erik,
I am not aware of any SSL implementation in haskell either (even
though I think it should go not into HTTP but into Crypto (which is a
neat piece of code, but needs a lot more work)).
I can think of two quick solutions if you need your Haskell code to
use an SSL link: run stunnel.org
Hello Peter,
Wednesday, October 7, 2009, 2:04:49 PM, you wrote:
afair, nhc was started there. it was a small compiler exactly because
Amiga was a rather small computer (comapred to RISC stations)
Yep. Commodore 64, Amiga. I really loved those machined, especially
the Amiga (mmm, maybe someone
afair, nhc was started there. it was a small compiler exactly because
Amiga was a rather small computer (comapred to RISC stations)
nhc12 (for Haskell 1.2) was first developed on an Acorn Archimedes
with 2Mb of RAM, under RiscOS.
Regards,
Malcolm
mf-hcafe-15c311...@etc-network.de wrote:
I am not aware of any SSL implementation in haskell either (even
I really find this rather surprising. Ocaml has a very decent wrapper
around Openssl that works rather well so it can't be that hard.
though I think it should go not into HTTP but into
On Wed, Oct 7, 2009 at 11:37 AM, Erik de Castro Lopo
mle...@mega-nerd.com wrote:
mf-hcafe-15c311...@etc-network.de wrote:
I am not aware of any SSL implementation in haskell either (even
I really find this rather surprising. Ocaml has a very decent wrapper
around Openssl that works rather
David Menendez wrote:
Floptical Logic wrote:
The code below is a little interactive program that uses some state.
It uses StateT with IO to keep state. My question is: what is the
best way to generalize this program to work with any IO-like
monad/medium? For example, I would like the
Actually I used it to fake the Pascal ord(x) function:
ord = fromEnum
Problem?
Michael
--- On Wed, 10/7/09, Bulat Ziganshin bulat.zigans...@gmail.com wrote:
From: Bulat Ziganshin bulat.zigans...@gmail.com
Subject: Re[4]: [Haskell-cafe] Creating an alias for a function
To: Luke Palmer
2009/10/7 michael rice nowg...@yahoo.com
Actually I used it to fake the Pascal ord(x) function:
ord = fromEnum
Problem?
Michael
If the monomorphism restriction applies, the compiler (assuming you're
using GHC) will tell you about it.
--
Deniz Dogan
Hello Deniz,
Wednesday, October 7, 2009, 5:03:59 PM, you wrote:
it depends. what i see with ghc 6.6.1:
C:\!\Haskellrunghc test.hs
test.hs:1:6:
Ambiguous type variable `a' in the constraint:
`Enum a' arising from use of `fromEnum' at test.hs:1:6-13
Possible cause: the monomorphism
2009/10/7 Bulat Ziganshin bulat.zigans...@gmail.com:
Hello Deniz,
Wednesday, October 7, 2009, 5:03:59 PM, you wrote:
it depends. what i see with ghc 6.6.1:
[snip]
Possible cause: the monomorphism restriction applied to the following:
ord :: a - Int (bound at test.hs:1:0)
Hello Deniz,
Wednesday, October 7, 2009, 5:23:24 PM, you wrote:
Possible cause: the monomorphism restriction applied to the following:
ord :: a - Int (bound at test.hs:1:0)
Probable fix: give these definition(s) an explicit type signature
or use
On Oct 7, 2009, at 3:13 AM, Ketil Malde wrote:
Peter Verswyvelen bugf...@gmail.com writes:
So yes, without using IO, Haskell forces you into this safe spot
One could argue that IO should be broken down into a set of sub-
monads
encapsulating various subsets of the functionality - file
Hi Tobias,
(I'm completely new to GPU programming, so my question may be completely
stupid or unrelated. Please be patient :-).)
Some time ago I needed to perform some large-scale computations
(searching for first-order logic models) and a friend told me that GPUs
can be used to perform many
It's a complex area not a lot of people are working in. Similar
(actually worse than) dependent typing.
Regards,
John A. De Goes
N-Brain, Inc.
The Evolution of Collaboration
http://www.n-brain.net|877-376-2724 x 101
On Oct 7, 2009, at 3:32 AM, Eugene Kirpichov wrote:
Or you can
On 7 Oct 2009, at 15:04, John A. De Goes wrote:
On Oct 7, 2009, at 3:13 AM, Ketil Malde wrote:
Peter Verswyvelen bugf...@gmail.com writes:
So yes, without using IO, Haskell forces you into this safe spot
One could argue that IO should be broken down into a set of sub-
monads
Hi all,
for people that have followed my posts on the DSL subject this question
probably will seem strange, especially asking it now.
I have read quite a lot lately on the subject, most of it written by the
great old ones, (come on guys you know whom I mean :)).
What I could gather from
Excerpts from Ketil Malde's message of Wed Oct 07 05:13:19 -0400 2009:
One could argue that IO should be broken down into a set of sub-monads
encapsulating various subsets of the functionality - file system,
network access, randomness, and so on. This could extend the safe
spot to cover much
Hi,
A DSL is just a domain-specific language. It doesn't imply any specific
implementation technique.
An *embedded* DSL is a library implemented in a more general language,
which has been designed to give the feeling of a stand-alone language.
Still nothing about implementation.
A
Let me add to this, as I've used the term DSL without (*gasp*) fully
understanding it before.
In addition to What is a DSL, I'd like to ask:
How is a DSL different from an API? -- in the sense that an API is a
set of, say, combinators to filter email + a monad in which to combine
them. Or
Hi Emil,
now that is an interpretation I could live with!
Glad I posted the question.
Günther
Am 07.10.2009, 17:24 Uhr, schrieb Emil Axelsson e...@chalmers.se:
Hi,
A DSL is just a domain-specific language. It doesn't imply any specific
implementation technique.
An *embedded* DSL is a
So, if I understand this:
Parsec is a DSL, I'm going to venture it's a Deep embedding -- I
don't understand the internals, but if I were to build something like
Parsec, I would probably build up a Parser datastructure and then
apply optimizations to it, then run it with another function.
Hi Joe
Am 07.10.2009, 17:26 Uhr, schrieb Joe Fredette jfred...@gmail.com:
Let me add to this, as I've used the term DSL without (*gasp*) fully
understanding it before.
Welcome to the club then! :)
In addition to What is a DSL, I'd like to ask:
How is a DSL different from an API? -- in
Hi,
Some random observation:
A (E)DSL and an API fall on the same plane when they just expose
functionality of a library.
The difference between EDSL and a DSL is really just the E which means
embedded into a host language so the embedded language can be built on
top of some existing machinery,
Daniel Fischer wrote:
Am Montag 05 Oktober 2009 16:29:02 schrieb Job Vranish:
In what way is it not a number?
If there's a natural[1] implementation of fromInteger, good.
If there isn't, *don't provide one*.
fromInteger _ = error Not sensible is better than doing something
strange.
[1]
On Wed, 2009-10-07 at 11:32 -0400, Joe Fredette wrote:
So, if I understand this:
Parsec is a DSL, I'm going to venture it's a Deep embedding -- I
don't understand the internals, but if I were to build something like
Parsec, I would probably build up a Parser datastructure and then
2009/10/7 Joe Fredette jfred...@gmail.com:
Let me add to this, as I've used the term DSL without (*gasp*) fully
understanding it before.
In addition to What is a DSL, I'd like to ask:
How is a DSL different from an API?
I don't think there is a sharp divide here. A nice example was given
by
I stand corrected. The answer was 'cabal install HsOpenSSL'.
On Wed, Oct 07, 2009 at 09:37:38PM +1100, Erik de Castro Lopo wrote:
To: haskell-cafe@haskell.org
From: Erik de Castro Lopo mle...@mega-nerd.com
Date: Wed, 7 Oct 2009 21:37:38 +1100
Subject: Re: [Haskell-cafe] Network.Curl and
This is probably an Xcode problem now, rather than a strictly Haskell
problem.
There are a bunch of libgmp.a and libgmp.dylib files in existence on this
computer, some in /usr/local/lib, or linked from there.
I've got my errors down to references in libgmp, whether or not I try to
include
Hi Don,
I've informally argued that a true DSL -- separate from a good API --
should have semantic characteristics of a language: binding forms,
control structures, abstraction, composition. Some have type systems.
That is one requirement that confuses me, abstraction.
I thought of DSLs as
Eugene Kirpichov wrote:
Or you can use an effect system (however that doesn't give you the
opportunity of overriding IO functions, but I think that providing
such an opportunity with the means you suggest (splitting IO into many
sub-monads) is not going to be usable in the large scale)
By
minh thu wrote:
2009/10/7 Günther Schmidt gue.schm...@web.de:
I've informally argued that a true DSL -- separate from a good API --
should have semantic characteristics of a language: binding forms,
control structures, abstraction, composition. Some have type systems.
That is one
On Wed, Oct 7, 2009 at 2:52 PM, Ben Franksen
But isn't one of the advantages of an _E_DSL that we can use the host
language (Haskell) as a meta or macro language for the DSL?
Substantially so. I've used brief examples where the EDSL syntax is
basically the data declaration (perhaps with some
2009/10/7 Ben Franksen ben.frank...@online.de:
minh thu wrote:
2009/10/7 Günther Schmidt gue.schm...@web.de:
I've informally argued that a true DSL -- separate from a good API --
should have semantic characteristics of a language: binding forms,
control structures, abstraction, composition.
What is a DSL?
How about this as a formal-ish definition, for at least a pretty big
class of DSLs:
A DSL is an algebraic theory in the sense of universal algebra. I.e. it
is an API of a specific form, which consists of:
a) a collection of abstract types, the carriers. Need not all be of
On Mon, 2009-10-05 at 19:22 -0400, David Menendez wrote:
The two obvious options are
call-by-name and call-by-value.
I wonder how easily one can provide both, like in Algol.
Fairly easy, you can either do a language that has an explicit monad (a
bit like Haskell with only the IO monad), or
On Mon, 2009-10-05 at 22:06 -0400, Chung-chieh Shan wrote:
Robert Atkey bob.at...@ed.ac.uk wrote in article
1254778973.3675.42.ca...@bismuth in gmane.comp.lang.haskell.cafe:
To implement the translation of embedded language types to Haskell types
in Haskell we use type families.
This
Hi Petr,
Your question is completely justified! Yes, I beleive GPipe is a good
foundation for such GPGPU-computations (general purpose GPU-programming),
giving you easy access to data parallelism.
A way of doing this is to start with one or more equally sized textures that is
your input (1
On Mon, 2009-10-05 at 22:42 +0100, Robert Atkey wrote:
There is a difference in the syntax between CBN and CBV that is not
always obvious from the usual paper presentations. There is a split
between pieces of syntax that are values and those that are
computations. Values do not have
Ben Franksen skrev:
minh thu wrote:
2009/10/7 Günther Schmidt gue.schm...@web.de:
I've informally argued that a true DSL -- separate from a good API --
should have semantic characteristics of a language: binding forms,
control structures, abstraction, composition. Some have type systems.
On Wed, Oct 7, 2009 at 12:08 PM, Ben Franksen ben.frank...@online.de wrote:
More generally, any ring with multiplicative unit (let's call it 'one') will
do.
Isn't that every ring? As I understand it, the multiplication in a
ring is required to form a monoid.
--
Dave Menendez
A ring is an abelian group in addition, with the added operation (*)
being distributive over addition, and 0 annihilating under
multiplication. (*) is also associative. Rings don't necessarily need
_multiplicative_ id, only _additive_ id. Sometimes Rings w/o ID is
called a Rng (a bit of a
Hi, I'm currently learning Haskell, and I've been trying to work out a
function for the following problem for a couple of days now.
I want to use a list comprehension method to change the first letter of a
string to upper case, and the rest of the string to lower case.
Eg: heLLo - Hello
As
I don't think a list comprehension is the easiest way to do it, how
about
upperCase :: String - String
upperCase [] = []
upperCase (x:xs) = toUpper x : map toLower xs
-Ross
On Oct 7, 2009, at 4:48 PM, Steven1990 wrote:
Hi, I'm currently learning Haskell, and I've been trying to work out a
Hint: Move the boundary case outside the comprehension, and then use
the comprehension to handle the normal case.
Also, FYI, a comprehension feeds each value of the list xs into x, and
then evaluates the expression to the left of the pipe with that single
value of x.
Cheers,
Greg
On
My thread about randomness got hijacked so I need to restate my remaining
question here. Is it acceptable to write pure routines that use but do not
return generators, and then call several of them from an IO monad with a
generator obtained by several calls to newStdGen?
shuffle :: RandomGen
On Wed, Oct 7, 2009 at 2:59 PM, Michael Mossey m...@alumni.caltech.edu wrote:
My thread about randomness got hijacked so I need to restate my remaining
question here. Is it acceptable to write pure routines that use but do not
return generators, and then call several of them from an IO monad
2009/10/7 Steven1990 stevenyoung1...@msn.com:
Hi, I'm currently learning Haskell, and I've been trying to work out a
function for the following problem for a couple of days now.
I want to use a list comprehension method to change the first letter of a
string to upper case, and the rest of
On Wed, Oct 7, 2009 at 1:59 PM, Michael Mossey m...@alumni.caltech.eduwrote:
My thread about randomness got hijacked so I need to restate my remaining
question here. Is it acceptable to write pure routines that use but do not
return generators, and then call several of them from an IO monad
Luke Palmer wrote:
On Wed, Oct 7, 2009 at 2:59 PM, Michael Mossey m...@alumni.caltech.edu wrote:
My thread about randomness got hijacked so I need to restate my remaining
question here. Is it acceptable to write pure routines that use but do not
return generators, and then call several of
For anyone following this: The XCode ld script is complex, and has mac
specific defaults early in the search path specification, and I probably
don't want to change these. A library in a default path is the wrong
libgmp.[dylib | a].
My solution:
do a
ln -s libgmp.a lib-h-gmp.a
in the
Am Mittwoch 07 Oktober 2009 22:44:19 schrieb Joe Fredette:
A ring is an abelian group in addition, with the added operation (*)
being distributive over addition, and 0 annihilating under
multiplication. (*) is also associative. Rings don't necessarily need
_multiplicative_ id, only _additive_
I was just quoting from Hungerford's Undergraduate text, but yes, the
default ring is in {Rng, Ring}, I haven't heard semirings used in
the sense of a Rng. I generally find semirings defined as a ring
structure without additive inverse and with 0-annihilation (which one
has to assume in
Am Mittwoch 07 Oktober 2009 23:28:59 schrieb Michael Mossey:
Luke Palmer wrote:
On Wed, Oct 7, 2009 at 2:59 PM, Michael Mossey m...@alumni.caltech.edu
wrote:
My thread about randomness got hijacked so I need to restate my
remaining question here. Is it acceptable to write pure routines
Try just writing a function that will change ALL the characters to uppercase
(or lower case) using list comprehension and then see if you can isolate how to
factor out the special case of the first character.
Michael
--- On Wed, 10/7/09, minh thu not...@gmail.com wrote:
From: minh thu
Am Mittwoch 07 Oktober 2009 23:51:54 schrieb Joe Fredette:
I was just quoting from Hungerford's Undergraduate text, but yes, the
default ring is in {Rng, Ring}, I haven't heard semirings used in
the sense of a Rng.
It's been looong ago, I seem to have misremembered :?
But there used to be a
HTZAAR is a Haskell implementation of TZAAR, a great little two-player
abstract strategy game designed by Kris Burm. TZAAR won Games
Magazine's Game-of-the-Year in 2008.
TZAAR has some interesting game dynamics. At each turn a player must
decide whether to attack or strengthen his own pieces.
Note that the Qt library supports CSS, and it's pretty fun and easy to use.
On Wed, Oct 7, 2009 at 5:05 AM, John A. De Goes j...@n-brain.net wrote:
Then change to early generation language. Point being CSS has plenty of
pioneering flaws.
Regards,
John A. De Goes
N-Brain, Inc.
The
On 2009-10-02 09:03 -0600 (Fri), John A. De Goes wrote:
[Haskell] is missing many key libraries that would be of great
commercial value.
Just out of curiousity, can you give me some examples of what you feel
these are?
cjs
--
Curt Sampson c...@starling-software.com+81 90 7737
On 2009-10-02 09:04 -0600 (Fri), John A. De Goes wrote:
I'm not saying Haskell is unstable. I'm saying that the attitude
expressed in the following quote is at odds with the needs of business:
And as far as something like dealing with a changing language and
libraries, the mainstream
On Wed, Oct 7, 2009 at 2:28 PM, Michael Mossey m...@alumni.caltech.eduwrote:
I don't quite follow your response. I want a program that initializes the
generator from the global generator because I want different behavior every
time I run it. So it will need IO. That's what I was trying to
2009/10/7 Robert Atkey bob.at...@ed.ac.uk:
What is a DSL?
How about this as a formal-ish definition, for at least a pretty big
class of DSLs:
A DSL is an algebraic theory in the sense of universal algebra. I.e. it
is an API of a specific form, which consists of:
a) a collection of
In Test.QuickCheck, the type of 'generate' is
generate :: Int - StdGen - Gen a - a
I can't find docs that explain what the Int does. Some docs are here:
http://www.haskell.org/ghc/docs/latest/html/libraries/QuickCheck/Test-QuickCheck.html
___
Curt Sampson wrote:
On 2009-10-02 09:03 -0600 (Fri), John A. De Goes wrote:
[Haskell] is missing many key libraries that would be of great
commercial value.
Just out of curiousity, can you give me some examples of what you feel
these are?
A version of Network.HTTP that accepts HTTPS
Daniel Fischer wrote:
Am Mittwoch 07 Oktober 2009 23:51:54 schrieb Joe Fredette:
I generally find semirings defined as a ring
structure without additive inverse and with 0-annihilation (which one
has to assume in the case of SRs, I included it in my previous
definition because I wasn't
mle+hs:
Curt Sampson wrote:
On 2009-10-02 09:03 -0600 (Fri), John A. De Goes wrote:
[Haskell] is missing many key libraries that would be of great
commercial value.
Just out of curiousity, can you give me some examples of what you feel
these are?
A version of Network.HTTP
On Wed, Oct 07, 2009 at 08:44:27PM -0400, Jason McCarty wrote:
Daniel Fischer wrote:
Am Mittwoch 07 Oktober 2009 23:51:54 schrieb Joe Fredette:
I generally find semirings defined as a ring
structure without additive inverse and with 0-annihilation (which one
has to assume in the case
Am Donnerstag 08 Oktober 2009 03:05:13 schrieb Felipe Lessa:
On Wed, Oct 07, 2009 at 08:44:27PM -0400, Jason McCarty wrote:
Daniel Fischer wrote:
Am Mittwoch 07 Oktober 2009 23:51:54 schrieb Joe Fredette:
I generally find semirings defined as a ring
structure without additive inverse
Don Stewart wrote:
A version of Network.HTTP that accepts HTTPS URLs and does the right
thing instead of attempting to do a HTTP connection instead.
Yeah, we use the curl library for all our HTTPS stuff.
Well there is a big difference between Network.Curl and Network.HTTP.
HTTP is really
I'm happy to announce the release of vty-ui 0.2.
Get it from Hackage:
http://hackage.haskell.org/package/vty-ui
Or get the source with darcs:
http://repos.codevine.org/vty-ui
This version of vty-ui is everything you hoped it would be: fewer
bugs, more widget types, cleaner code, better
On Wed, Oct 7, 2009 at 8:29 PM, Michael Mossey m...@alumni.caltech.edu wrote:
In Test.QuickCheck, the type of 'generate' is
generate :: Int - StdGen - Gen a - a
I can't find docs that explain what the Int does. Some docs are here:
Hi,
I'm trying to compile some code using Cabal. One of the files has a CPP
directive
#include undefined.h
The file undefined.h is in the same directory as the file with the
directive.
If I use the full path name, cabal can compile it. However, if I use the
relative path,
it complains about
84 matches
Mail list logo