Arie,
Thanks for your thoughtful reply. Comments in-lined.
Best wishes,
--greg
Date: Thu, 2 Aug 2007 03:06:51 +0200 (CEST)
From: Arie Peterson [EMAIL PROTECTED]
Subject: Re: [Haskell-cafe] Re: monads and groups -- instead of loops
To: haskell-cafe@haskell.org
Message-ID: [EMAIL PROTECTED]
On Thursday 02 August 2007 15:57, ok wrote:
It all depends on what you mean make sense to.
I can tell my student that (an instance of Monad) is a type constructor
applications of which support certain operations that must satisfy
certain operations. They can memorise that. But it remains
Hello David,
Thursday, August 2, 2007, 12:48:07 AM, you wrote:
about concurrency - necessarily read paper Tackling the awkward squad:
monadic input/output, concurrency, exceptions, and foreign-language calls in
Haskell
On 1 Aug 2007, at 21:23, Greg Meredith wrote:
But, along these lines i have been wondering for a while... the
monad laws present an alternative categorification of monoid. At
least it's alternative to monoidoid. In the spirit of this thought,
does anyone know of an expansion of the monad
On Thu, Aug 02, 2007 at 04:15:35PM +1200, ok wrote:
On the other hand, I've usually found that it pays to avoid
explicitly constructing things like Cartesian products. Could that
be the case here?
Quite possibly, though for my purposes I don't _think_ it's worth
routing around it.
I'm
On 02/08/07, Alexis Hazell [EMAIL PROTECTED] wrote:
It's at this point that i feel there's an issue. Haskell Monads are used FOR
many many things. And rather than get to the core of what a Monad is, many
people provide two or three motivating examples - examples which merely serve
to show
My answers apply to Windows/GHC.
David Pollak wrote:
* Can GHC generate stand-alone executables with all the dependencies
linked in such that I can distribute the single file without
worrying about including a bunch of DLLs/SOs? The answer seems to
be yes, but I wanted
On Wed, 1 Aug 2007, Dave Tapley wrote:
Hi all,
I'm having a lot of trouble using renderString from Graphics.UI.GLUT.Fonts.
All my attempts to render a StrokeFont have so far failed.
Using a BitmapFont I can get strings to appear but they demonstrate
the odd behaviour of translating themselves
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of peterv
However, one thing which I find annoying is that a classic
pure function cannot evaluate an IO function unless you use
unsafePerformIO; one must promote (?demote) the pure
function into the IO monad.
That's just a
On 8/2/07, Dougal Stanton [EMAIL PROTECTED] wrote:
Do I have an suggestions? Well, maybe the right way would be to do as
we do with map and fold, etc: show the explicitly recursive example,
then generalise. So, show how we could we would thread state in
Haskell, or how we would do optional
On 8/2/07, Dave Tapley [EMAIL PROTECTED] wrote:
Using a BitmapFont I can get strings to appear but they demonstrate
the odd behaviour of translating themselves a distance equal to their
length every time my displayCallback function is evaluated.
I've never used OpenGL from Haskell, but it
Hi Dave, everyone...
Dave Tapley wrote:
Hi all,
I'm having a lot of trouble using renderString from Graphics.UI.GLUT.Fonts.
All my attempts to render a StrokeFont have so far failed.
Using a BitmapFont I can get strings to appear but they demonstrate
the odd behaviour of translating themselves
Your code is not rendering stroke font, but bitmap. Use the following
code to render str at x and y position.
GL.currentRasterPosition $= vertex4 x y 0 1
GLUT.renderString GLUT.Fixed8By13 str
where vertex4 is defined as:
vertex4 :: Float - Float - Float - Float - GL.Vertex4 Float
GHC as of now won't be able to recognize your change to the dynamic
libraries on the fly. So if you want to use new features, you'll have
to compile GLUT package for GHC freshly on top of your new freeglut.
Get the GLUT source from hackage.haskell.org and do the cabal
installation. GHC will then
Are you trying it on Linux?
I had exactly the same problem. I believe it's with with X11/OpenGL.
I've written C programs using GLUT, freeGLUT and GLFW (another OpenGL
Window Kit) to re-open window after first one is closed. Unfortunately
all gave the same fault. So it leads me to believe the
On Thu, 2007-08-02 at 18:44 +0200, Wolfgang Jeltsch wrote:
Am Donnerstag, 2. August 2007 12:22 schrieb Henning Günther:
[…]
ISO 8859-* (alias latin-*)
Not every ISO-8859-* encoding is a Latin-* encoding.
[…]
Wouldn’t it be good to use some already existing library like iconv
Hmm. Good point. Fixed.
Smion
| -Original Message-
| From: Stefan O'Rear [mailto:[EMAIL PROTECTED]
| Sent: 26 July 2007 01:01
| To: Simon Peyton-Jones
| Cc: Bulat Ziganshin; haskell-cafe@haskell.org; Jon Fairbairn
| Subject: Re: [Haskell-cafe] Re: how to see operators precedence in GHCi
On Thursday 26 July 2007 00:07:23 Josef Svenningsson wrote:
On 7/26/07, Jon Harrop [EMAIL PROTECTED] wrote:
Does Haskell have anything similar to OCaml's polymorphic variants?
No as such, but it's possible to simulate them. As always Oleg was the
one to demonstrate how:
Alexteslin wrote:
Hi, I am doing some simple exercises about recursive algebraic types and
this particular exercise asks to define a function which counts the number
of operators in an expression. I defined the function below, but i am not
sure if on the second line changing from
Any suggestions for a perfect example that uniquely demonstrates the benefits
of the Haskell language compared to other languages?
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?e
as far as i know, the haskell standard does not define a basic Int
type that is limited to positive numbers.
would a type of this kind not potentially allow us to make stronger
verification statements about certain functions?
for example, 'length' returns an Int, but in reality it must always
On Thu, Aug 02, 2007 at 12:17:06PM -0700, brad clawsie wrote:
as far as i know, the haskell standard does not define a basic Int
type that is limited to positive numbers.
would a type of this kind not potentially allow us to make stronger
verification statements about certain functions?
I've heard Simon (Peyton-Jones) twice now mention the desire to be able
to embed a monadic subexpression into a monad. That would be
http://article.gmane.org/gmane.comp.lang.haskell.prime/2267 and in the
recent OSCON video. Is someone working on implementing this?
If no, I'll take a crack
Dear all,
I am pleased to announce version 0.6 of the Dimensional library.
Dimensional is a library providing data types for performing
arithmetic with physical quantities and units. Information about the
physical dimensions of the quantities/units is embedded in their types
and the validity
Ok,
I am guessing that if you were Neo in The Matrix, you would have taken
the Blue Pill. Blue Pill people ask How.
I suspect most people attracted to Haskell have already taken the Red
Pill. Red Pill people ask Why.
It is compulsion, not self-interest, that drives Red Pill people to look
On Thu, Aug 02, 2007 at 12:29:46PM -0700, brad clawsie wrote:
On Thu, Aug 02, 2007 at 12:17:06PM -0700, brad clawsie wrote:
as far as i know, the haskell standard does not define a basic Int
type that is limited to positive numbers.
would a type of this kind not potentially allow us to
Of course, you can always do this:
data Nat = Zero | Succ Nat
but it's not very much fun to work with, and not very efficient.
Mike
David Roundy wrote:
On Thu, Aug 02, 2007 at 12:29:46PM -0700, brad clawsie wrote:
On Thu, Aug 02, 2007 at 12:17:06PM -0700, brad clawsie wrote:
as far as i
It seems you are confusing the notion of counting the number of
operators in the expression with actually evaluating the expression.
Your evalLength function does both.
It may help to consider counting the number of operators in the
expression to be the same as calculating the height of the
On Thu, Aug 02, 2007 at 02:08:33PM -0700, David Roundy wrote:
This would be a very nice type to have (natural numbers), but is a tricky
type to work with. Subtraction, for instance, wouldn't be possible as a
complete function...
Of course it would. It would just have the type Nat - Nat -
On Thu, Aug 02, 2007 at 10:27:47PM +0200, Björn Buckwalter wrote:
I am also assuming that the CGS system would not be employed when
working with temperature, amount or luminosity. This is evident in
the below type signatures where I have assumed zero extent in the
temperature, amount and
Hi Chris,
Simon mentioned this to me as a possible project when I started my
internship here at MSR, so I'm pretty sure this is both on the wish-list
and not already taken (but we should check with Simon to make sure).
I've since wished for it a few times as I've been implementing view
patterns,
On Thu, Aug 02, 2007 at 12:17:06PM -0700, brad clawsie wrote:
as far as i know, the haskell standard does not define a basic Int
type that is limited to positive numbers.
Haskell 98 doesn't have such a type, no, but in today's libraries there
is Data.Word.Word. Operations like subtraction will
I wrote:
But please, let's keep one foot in the real world if possible.
Monads were invented to solve the how do I do imperative programming
in a pure functional language problem.
On 2 Aug 2007, at 7:05 pm, Greg Meredith wrote:
This is more than a little revisionist. Monads have been the
David Roundy wrote:
On Thu, Aug 02, 2007 at 10:27:47PM +0200, Björn Buckwalter wrote:
I am also assuming that the CGS system would not be employed when
working with temperature, amount or luminosity. This is evident in
the below type signatures where I have assumed zero extent in the
ok wrote:
It is considerably more than a little revisionist to identify Haskell
monads with Category Theory monads.
So a category theory monad is a functor from some category to itself.
How is IO a a functor? Which category does it operate on? What does it
do to the points of that
My category theory is pretty weak, but I'll take a stab (others can
correct me if I say something stupid):
ok wrote:
It is considerably more than a little revisionist to identify Haskell
monads with Category Theory monads.
Quoting the Wikipedia article on monads:
If F and G are a pair of
On 8/2/07, David Roundy [EMAIL PROTECTED] wrote:
This would be a very nice type to have (natural numbers), but is a tricky
type to work with. Subtraction, for instance, wouldn't be possible as a
complete function...
There is a subtraction-like operation for naturals, where a - b = 0 if
a = b.
On Fri, Aug 03, 2007 at 01:45:03AM +0100, Neil Mitchell wrote:
Hi
Catch (www.cs.york.ac.uk/~ndm/catch) can infer that certain uses of
numbers fit into the {Neg, Zero, One, Pos} abstraction - so for
example it can infer that length returns {Zero, One, Pos}, but not
Neg. If you then do:
xs
Hi
Catch (www.cs.york.ac.uk/~ndm/catch) can infer that certain uses of
numbers fit into the {Neg, Zero, One, Pos} abstraction - so for
example it can infer that length returns {Zero, One, Pos}, but not
Neg. If you then do:
xs !! length ys
It will detect that length ys is natural, and will be
Hi
I know that Audrey Tang (the Pugs project) has used hamming numbers
for this, see http://www.perl.com/lpt/a/959
Thanks
Neil
On 8/2/07, Jon Harrop [EMAIL PROTECTED] wrote:
Any suggestions for a perfect example that uniquely demonstrates the benefits
of the Haskell language compared to
Hi Chris,
I've heard Simon (Peyton-Jones) twice now mention the desire to be able
to embed a monadic subexpression into a monad.
I think this is a fantastic idea, please do so!
$( expr ) -- conflicts with template haskell
( - expr ) -- makes sense, and I think it's unambiguous
That's a tough one,
If I want a small example to show to people I usually use zipWith. It
is higher-order and lazy, and I include a discussion of lists as
loops, which means zipWith is a loop combiner. When my audience is C
programmers I ask them to implement it in C, which is always
Hi
It will detect that length ys is natural, and will be safe. However,
if you pass any arbitrary value as the index to !! it will warn of a
possible pattern match error.
I hope catch doesn't actually think that's safe, because it's not - set
ys = xs = [1,2,3,4,5], you'll get an index
I asked How is IO a functor?
On 3 Aug 2007, at 11:50 am, Dan Piponi wrote:
IO is a fully paid up Monad in the categorical sense. The category is
the category whose objects are types and whose arrows are functions
between those types. IO is a functor. The object a maps to IO a. An
arrow f::a-b
On 8/2/07, ok [EMAIL PROTECTED] wrote:
I asked How is IO a functor?
Please go over this again, but slowly this time.
Try it... by golly it's true.
I'm not fibbing. I was surprised as you when I found out about this stuff!
So why *aren't* Monads already set up using the type class machinery
Ok, after spending some time looking for a solution, here is a stroke
of genius by wxHaskell folks at
http://wxhaskell.sourceforge.net/building-macosx.html
I've tried this enableGUI trick using GHCi, it works with my GLFW
interface to Haskell which suffered from the same problem as GLUT on
OS X,
On Thu, 2007-08-02 at 21:29 -0600, Chris Smith wrote:
Neil Mitchell [EMAIL PROTECTED] wrote:
I think this is a fantastic idea, please do so!
Okay, I'll do it then. If I have a good weekend, perhaps I'll volunteer
a talk at AngloHaskell after all! :)
So what about syntax? I agree
bayer:
If one is calling runInteractiveCommand for a sure-thing returning a small
amount of output (say, ls for a modest directory), is it necessary to call
waitForProcess?
My waitForProcess calls came under scrutiny when I tried to GHC profile a
threaded process, which isn't possible. It
Neil Mitchell [EMAIL PROTECTED] wrote:
I think this is a fantastic idea, please do so!
Okay, I'll do it then. If I have a good weekend, perhaps I'll volunteer
a talk at AngloHaskell after all! :)
So what about syntax? I agree with your objections, so we've got
( - expr ) -- makes
Derek Elkins [EMAIL PROTECTED] wrote:
( - expr ) -- makes sense, and I think it's unambiguous
``expr`` -- back-ticks make sense for UNIX shell scripters
The latter is not sensible to me at all. It doesn't nest well.
Ah, excellent point! Okay, it's gone then. Everything will then
Hello Jon,
Thursday, August 2, 2007, 11:02:14 PM, you wrote:
Any suggestions for a perfect example that uniquely demonstrates the benefits
of the Haskell language compared to other languages?
http://www.haskell.org/haskellwiki/Simple_unix_tools
--
Best regards,
Bulat
51 matches
Mail list logo