I'd like to ask some questions about the structure of the Num class, in
particular why aren't the intrinsic sub-classes of Ring and Field separated
out from the definition of Num and Fractional?
Why not have something like the following?
\begin{code}
class Ring a where
(+), (-), (*)
In response to Marnix Klooster <[EMAIL PROTECTED]> and
S.D.Mechveliani <[EMAIL PROTECTED]>, can I offer another
mathematic perspective to explain why gcd(0,0) should be zero?
Just looking at the natural numbers, the relationship "a divides b",
written a|b, defines a partial order. We c
[System specific postings aren't normally relayed onto the haskell
list, but made an exception here since it discusses general
(Standard) Haskell features. -moderator]
Are there any plans to implement multiple parameter type classes in Hugs
any time soon? I'd really really like them!
I'
I think that this is a VERY good idea!
Each expression then has a set of possible types, and the ambiguity is
resolved by an explicit type signature.
At present it is quite frustrating in Haskell that when a name is used in
one place it is then lost for use in any other context -- the ex
I'm going to ask a very stupid question.
Why on earth is len computed twice in this example? I really don't
understand this!
(However, I don't understand the monomorphism restriction either, so the
moderator may want to drop this message!)
Surely as len takes no arguments, the contexts
CC: [EMAIL PROTECTED]
Yes, I think I understand this. The two contexts of len *aren't* the
same, are they?
Actually, in the circumstances I think that this is correct behaviour!!!
Now, how do we fix it? Can we use type signatures to help us out here?
We know that
f :: (Num c) => [a]
CC: Simon L Peyton Jones <[EMAIL PROTECTED]>
I do think that the GNU license would be a mistake -- as I understand, it
would prevent the use of GHC in commercial projects, and I'm pretty sure
that's something Simon wants to *encourage*.
--
From: jfk
Sent: 21 July 1998 20:20
To:
12:00
To: Simon L Peyton Jones <[EMAIL PROTECTED]>;
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Scoped typed variables.
To: Simon L Peyton Jones <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
Subject: RE: Scoped typed variables.
| Michael suggested
|
| f :: [a] -> c
| f xs
CC: [EMAIL PROTECTED]
But the problem is that I need the type name c inside the body of the
function! I'm assuming always that I can solve a typeing problem by
adding an explicit type signature wherever it's needed; however, that
implies that I need to be able to get at the type names.
Alex Ferguson <[EMAIL PROTECTED]> wrote in reply to Jeff Lewis:
| > ... I can't think of a good rationale for it (aside from the "don't
break
| > old code" argument, which, if that's the only argument, doesn't seem
| > strong enough to me).
|
| For Standard Haskell at least, it ought to be a
Hi,
My name is Michael. I'm new to Haskell. I'm working through
The Craft of Functional Programming by Simon Thompson.
I'm having problems with a few exercises from chapter 4. I will
present one per post.
This one is from 4.9
Given a function f of type In
contents of a file as a string, and a third
function that joins the two:
> countLines :: String -> Int
> readFile :: String -> IO String
> main = do
> fileContents <- readFile "foo.txt"
> print (countLines fileContents)
- Michael Hobbs
Marcin 'Qrczak' Kowalczyk wrote:
>
> Fri, 05 Nov 1999 09:42:20 -0600, Michael Hobbs <[EMAIL PROTECTED]> pisze:
>
> > Monads do indeed have a viral nature to them. That is, once you use a
> > monadic function, you are required to make the calling function m
What version of cmucl is haskell intended for? I'm having some trouble
putting it up under the current version 16e.
In support/cl-support/cl-init.lisp
(namestring (make-pathname :type (c:backend-fasl-file-type c:*backend*)))
is illegal.
---
Ralf Hinze wrote:
> As it stands `sortBy' is more general than `sort': I can define `sort'
> in terms of `sortBy' but not the other way round. [However, sometimes
> it is far more convenient to implement `sort' than `sortBy'.]
>
> > sort = sortBy (<=)
Just to add a voice to support you
Felix Schroeter wrote:
> > for instance, i could want to sort a list,
> > according to two different criteria,
> > using two different instances of Ord.
>
> newtype IntFunnilyOrdered = IFO Int
> instance Ord IntFunnilyOrdered where
> compare (IFO x) (IFO y) | even x && even y = compare x y
>
on supports this.
This sounds interesting but how did you implement it?
As far as I know, the problem of type inference with polymorphic
recursion is undecidable due to the undecidability of the
semi-unification problem.
---
Michael Hanus
Informatik II eMail: [EMAIL PROTECTED], [EMAIL PROTEC
ween two functions that
happen to be named the same? Ad hoc polymorphism is probably the most
"convenient" differentiation mechanism, but is it the "best"?
Mind you, I don't have any brilliant solutions. I just thought that I
might clarify(?) the problem a bit.
- Michael Hobbs
n
interface defined for the language. I would like to have my programs
compile on
any ``Haskell 2 compliant'' compiler without having to go through
implementation-specific precompilers like Green Card. To make the
specification
simple, I think all that would need to be defined is a way to invoke a
library
routine. (No special in-line C code syntax, etc. However, callbacks
could be a
bear.)
I'm done now,
Michael Hobbs
bly take a closer look at this in the near future. BTW, what's
the ETA for exporting Haskell functions to the outside with H/Direct?
Thanks,
Michael Hobbs
Haskell would
provide a very good framework for using relational algebra in order to
combine and extract data. (In contrast to using something like a
Structured Query Language.) I dabbled with this a bit, but didn't get
very far before I lost interest. :)
Michael Hobbs
found it difficult
to believe that such a complex system would be useful in general
practice. (Also, I'm not a mathematician who does a significant amount
of work in category theory, so that may contribute to its apparent
awkwardness to me.)
- Michael Hobbs
(I meant to send this to the Haskell list this morning, but hit reply and
didn't get what I expected!)
-Original Message-
From: michael abbott [mailto:[EMAIL PROTECTED]]
Sent: 28 January 1999 10:13
To: 'Jose Emilio Labra Gayo'
Subject: RE: A simple question on Hask
ngs
such as parsing LL(1) grammars, but I could not see how such a scheme
could become a _replacement_ for monads in general purpose programming.
Perhaps I was expecting the wrong thing from the concept...
- Michael Hobbs
special
testing.
Regarding the integers >=0 as a partial order with a<=b when a|b (a divides
b) then gcd a b is the lattice meet of a and b, and 0 is the top element.
Defining gcd 0 x = 0 is consistent with this, for any x.
Michael Abbott
h as:
polyX :: MaybePoly a -> a
polyX (IsPoly x) = x
polyX (NotPoly str) = str
But that fails to type-check.
Thanks for all input,
Michael Hobbs
As a C++ user (with a background in categories) patiently waiting for
something a lot better, I personally favour two principles:
1. let's go for undecidable type checking. I want the compiler to be able
to do as much work as possible: ideally, everything that can be resolved at
compile time
b = WVString String | WVShow a | WVElse b
but this is not easily extendable for ad-hoc situations. (I haven't even
verified if the above statement will really work. I have only done the
MaybePoly)
- Michael Hobbs
' (i - 1) (sum + (f i))
More "elegant". That is, shorter:
> g :: Integer
> g = sum (map f [0..20])
A perhaps more efficient version of the previous function.
> g :: Integer
> g = foldl (\sum i -> sum + (f i)) 0 [0..20]
Hopefully, that will give you a few ideas of the things you can do with
a functional language.
- Michael Hobbs
ake sense to use existential
quantification? It would be helpful if such a document used valid
examples (i.e., no functions or types named "foo") so that I can see
what Read World(tm) problem is being solved.
- Michael Hobbs
data Dish = Meat' DMeat | Vegetable' DVegetable | ... -- 50 items
would it be possible to use:
data Dish = DMeat {mName :: String, ...}
| DVegetable {...}
| DVine {...}
| ...
This would eliminate the need to have a multi-type list, for this
particular example anyway.
- Michael Hobbs
fashion
(IMHO). (Though, not necessarily in as mathematically rigorous a
fashion.) The weakness that I pointed out above was in regard to using
pattern matching types vs. type classes. With type classes, you can
declare an instance in any module and the instance declarations
typically don't step on each others' toes.
- Michael Hobbs
t; foo 0 = []
> foo x = ['1'] ++ foo(x - 1)
According to your implementation, the type of `foo' isn't `Int -> [a]'
it's `Int -> [Char]'. That is, the compiler knows that the only thing
that can ever be in the list is characters. Therefore, it complains when
mode).
Is this a bug/feature of these systems or is there something
wrong with the grammar in the report?
Michael
---
Michael Hanus
Informatik II eMail: [EMAIL PROTECTED], [EMAIL PROTECTED]
RWTH Aachen Phone: +49-241/80-21230
D-52056 Aachen Fax: +49-241/-217
Germany
ecific features, but if something like existential types is
just what I need, I guess I can bite the bullet.
Thanks,
- Michael Hobbs
a)
However, just to get things working, you can remove the type variable
and use:
data BTree = Leaf Integer | Node Integer (BTree Integer)
- Michael Hobbs
Else, you could just use the (++) operator and hope that one of the
compilers is optimized to handle it in less than O(n) time. :)
- Michael Hobbs
ever contributed code to a FP
project, etc. It could help get a pulse of where people are at and what
they would be willing to do.
Not that *I* have the time to create such a web site. :-)
- Michael Hobbs
on
and spits out standard Haskell code, which uses the conventions I
alluded to above? My current project probably isn't large enough to
warrant the effort, but if someone else could use it I might be willing
to go the extra mile.
- Michael Hobbs
Martin Norb{ck wrote:
> Have you looked at Haskell++?
> http://www.cs.chalmers.se/~rjmh/Software/h++.html
Wasn't aware of its existence. Thanks for the pointer. I'll be sure to
look into it.
- Michael Hobbs
Fergus Henderson wrote:
> On 27-Aug-1999, Michael Hobbs <[EMAIL PROTECTED]> wrote:
> > Those who are into the more esoteric aspects of OO know that an object
> > has both a "type" (interface) and a "class" (implementation).
>
> Yes, but of cour
ollowing:
data Sequence a = MkSeq {
cons :: a -> Sequence a,
... }
class SequenceClass seq a where
mkSequence :: seq a -> Sequence a
empty :: seq a
data Stack a = MkStack (Sequence a)
...
push a (MkStack seq) = MkStack (cons seq a)
...
instance SequenceClass [] a where
mkSequence list = let
cons a = mkSequence (a:list)
...
in MkSeq cons ...
empty = []
- Michael Hobbs
askeldoc program?
> Comments anyone?
>
> Andy
What's the thinking on this? As a supplement to, or instead of Literate
Haskell? Not that I've ever really used Literate Haskell, but I had
always planned on using it someday. ;-)
- Michael Hobbs
that I was probably
competing against hard-core compiler writers, I didn't have much heart.
;-)
- Michael Hobbs
e this is kinda' what you were looking for,
- Michael Hobbs
Havoc Pennington wrote:
>
> Hi,
>
> I'm trying to learn Haskell, and I'm wondering what experiences people
> have with designing programs with graphical user interfaces. Assume for
> the moment that a GUI impl
Dear List,
Has anyone tried to implement non-commutative polynomials or general
non-commutative algebra in Haskell? I remember a previous post for a
commutative algebra package and was wondering if anyone was working on
non-commutative versions. Thanks.
Christopher Jeris wrote:
>
> Here is another one for haskell-newbies, really. :)
>
> Does anybody else wish for Ix.increment and Ix.decrement ? I have been
> writing some matrix code and whenever I want to refer to "the next row
> down" I have been writing (range (i0,i1))!!1, which seems inele
;t strictly necessary when you have
polymorphic types. But sometimes, syntactic sugar really is a Good
Thing. I don't have to retype or copy-and-paste. Neither do I have to
rework all the functions to be more "generic". It may not be good
programming practice, but hey, we can't always be perfect.
- Michael Hobbs
hat's defined in the hypothetical SystemState module.
Or were you thinking of something even more elegant? (I must admit that
I haven't looked at MetaML yet.)
- Michael Hobbs
d probably dog-slow, but not a bad "idea". ;-) Actually,
you're right, I really should take a look at the existing systems first.
(i.e., MetaML) (Meta-Meta-Language?)
BTW, if you can't tell by the smirk on my face, I'm not really all that
serious. I'm just stating what (IMHO) would be the ultimate goal.
Regards,
- Michael Hobbs
s fed into the second. Whether
or not you want to call this "referentially transparent", well I guess
that's up to your own philosophic bias.
- Michael Hobbs
Michael Hobbs wrote:
>
> Adrian Hey wrote:
> > I've read this paper, and it is good, but I still see no reason to
> > change my opinion regarding referential transparency and IO.
> > But I am terribly confused about this issue, there seems to be no real
> > c
Michael Hobbs wrote:
> > Consider this:
> > > type IO a = StateOfUniverse -> (a, StateOfUniverse)
> > > -- Not syntactically correct, but you know what I mean.
> >
> > So anything that is declared, say `IO Int', means that it is actually a
> >
be gormed if I can find any
reference to any such effort on haskell.org. Fortunately, someone on
this list supplied a reference to Haskell++, whose ideas I'm in the
process of stealing. :)
- Michael Hobbs
here.)
The only documentation for unzip is this:
unzip = foldr (\(a,b) ~(as,bs) -> (a:as,b:bs)) ([],[])
Not exactly intuitive. Could be better. I'm assuming that George's point
is that this documentation leaves plenty of room for expansion.
- Michael Hobbs
"S. Alexander Jacobson&
ns will be Monday 20 December 1999.
Thanks a lot,
Michael Mendler
em is responsible for taking the output, compiling it,
and then executing the FORTRAN program.
That's the "theory" anyway. In practice, I imagine that there is a more
intimate conjunction between the runtime system and the Haskell code.
- Michael Hobbs
(*) One place where the World -
sophical
conclusions about what it "means".
My original intent was to say that if you describe 'IO a' values simply
as _unevaluated_ imperative actions and throw away notions of
referential transparency and World states, then *poof* no more nasty
philosophy debates. :-)
- Michael Hobbs
Jerzy Karczmarczuk wrote:
> BTW. Hobbs term "_unevaluated_ imperative action" is something as
> nice and meaningful for me as, say "revolutionary justice", or
> "popular democracy". [[appropriate smiley, please.]]
Is Adrian's substitution of "unexecuted imperative action" more
meaningful for you.
polymorphism. After
all, the word "patterns" is a big buzzword in industry right now, which
is very close to his notion of frameworks.
A person would *love* to use templates in C++, if only it wasn't so
broken,
- Michael Hobbs
Adrian Hey wrote:
>
> On Mon 24 Jan, Michael Hobbs wrote:
> > (*) One place where the World -> (World, a) model breaks down is when
> > the IO function is a blocking function such as "getChar :: IO Char". If
> > this function was equivalent to World ->
I believe that there is a nanosecond value in one of the data types
specified in the Time module. (One of the Haskell 98 libraries) I don't
know if Hugs supports that module, though. I know GHC does.
Nick Eby wrote:
>
> Is there a straightforward way to access the current system time in
> haskel
[EMAIL PROTECTED] wrote:
>
> This is probably a stupid question, but...
> Are there any jobs out there to be had programming in haskell?
> My apologies if this is inapropriate for this list or if I missed it on the
> web site.
> Thanks-
> Brett
I have never met an employer that has so much as ev
;ve used haskell
for anything "real", so be gentle please!
Cheers,
Michael
PS: This is with a freshly downloaded ghc-4.06-1.i386.rpm
.
val = 3 +! 4 *! 2
where (+!) = (+)
(*!) = (*)
infixl 7 *!
infixl 6 +!
(*!) = 1 -- dummy defs
(+!) = 2
doesn't work in either hugs or ghc (and I didn't think it
would). Never mind, I'll just bracket everything.
> Sorry about this
Not a big problem (he says now...).
Cheers,
Michael
Peter Hancock <[EMAIL PROTECTED]> writes:
> Somewhat related to this,
> ghc-4.06-1.src.rpm
> has a problem. It builds OK (taking several hours on my machine) till
> the very end, then dies trying to invoke some program called db2dvi.
> I can't find a redhat package that contains this.
Well, i
n2 where (gen1, gen2) = split gen
or to increment the seed in the recursive call like:
stdGens1 :: [StdGen]
stdGens1 =
stdGens' seed
where
stdGens' seed = mkStdGen seed : stdGens' (seed + 1)
The latter solution seems to work pretty well.
Thanks for hints,
Michael Marte
-- Forwarded message --
Date: Fri, 24 Mar 2000 15:11:46 + (GMT)
From: Deryck F Brown <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: Random numbers
Michael,
> stdGens1 :: [StdGen]
> stdGens1 =
> stdGens' seed
> where
> std
function has the following
type:
Pair :: Int -> Int -> Pair
(hint, hint)
> .. This is my first attempt at haskell -- and although I am not looking
> for the solution, I was wondering if anyone could help me :()
Hope I didn't give away too much. :-)
- Michael Hobbs
. Dr. Michael Hanus
Institut fuer Informatik und Praktische Mathematik
Technische Fakultaet der Christian-Albrechts-Universitaet zu Kiel
Olshausenstr. 40
D-24098 Kiel, Germany
Email: [EMAIL PROTECTED]
URL: http://www.informatik.uni-kiel.de/~mh/
Further links:
Official version of this
doubles and it didnt help... Thx much ;-)
You have to print the strings, not the list; try something like
printBookList = putStr . concat
printBooks = printBookList . listBooks
HTH,
Michael
e in a closed source
environment.) Probably not as good as the entropy daemon, anyway.
I believe that the P3 chips come with a noisy diode built-in,
specifically for the purpose of generating random numbers. You might try
to find a way to access that little gizmo. (Assuming that you're running
on
Ketil Malde wrote:
> Michael Hobbs <[EMAIL PROTECTED]> writes:
> > I believe that the P3 chips come with a noisy diode built-in,
> > specifically for the purpose of generating random numbers.
>
> Apparently, the Intel i810 chipset also contains a hardware random
>
where
(p, p') = partition (eq x) xs
There is a single difference: The use of span vs. partition, i.e.
grouping and computing equivalence classes are very similiar. Indeed,
if a set is represented by a sorted list, grouping can be used to
compute its equivalence classes efficiently.
Michael Marte
Hello,
is it possible to have class instances local to a module or a function?
This would be very useful since it occurs quite often that certain
instances are appropriate for most modules but one.
Michael
the number of decimal points, before rounding. I don't like
this because it might cause an overflow.
I ended up using Numeric.ShowFFloat. I don't like this solution because it
is unnecessarily complicated.
Michael
> Michael Marte wrote:
>
> > I have a simple problem but it seems to be quite involved: I want to print
> > floating point numbers with a given number of decimal points.
> >
> > First, I found out that both ghc and hugs do not consider the precision
> > argum
changes necessary to make it Windows compatible, I'll try my best
to incorporate them.
[1] we've got Linux/{i386,alpha}, Solaris/SPARC, xBSD, etc. but
Windows only on the secretary's computer, and they'll beat me up,
if I dare to install GHC on it and develop software
you.
Michael Marte
I read GITH and some of the other
introductory material around. A lot of this probably is
more relevant to the people who are thinking of writing
a lower-level intro than it is to the next edition of
The-Document-Formerly-Known-As-GITH.
My plea is for people include introductory material for people
who
.de/~pakcs)
(Curry is an extension of Haskell to deal with logic and concurrent
programming features) and made very good experiences with it,
in particular, there was a considerably speed-up when recompiling
larger applications.
Michael
___
eads.
If either the producer or the compressor are executed in a thread, the
compressor bails out complaining that some resource is not available.
So what's going on? How can the goal be achieved?
Thank you,
Michael
___
Haskell mailing list
[EMAIL
decompression
> of strings (String -> String).
The wrapper works fine, except for - when bunzipping a file -
bunzip complains like this:
bunzip: wbg-5-11-0.xml.bz2: trailing garbage after EOF ignored
Indeed, the file produced by the Haskell program is one byte longer
I am interested in pursuing practical development of persistence in Haskell.
To this end I have been looking for code/systems which have been developed
previously to build upon - not wishing to reinvent the wheel.
I have found some references in the literature but have been enable to track
down a
ses, there is a natural choice for d (e.g., in
the integers, the non-negative d; in the ring of polynomials over a
field, the monic d (having leading coeff. 1)). In some UFDs there is no
canonical choice (e.g. in the Gaussian integers, a + ib for a, b integers).
gcd(0, 0) = 0.
Cheers,
Michae
each x_i.
Cheers,
Michael Ackerman
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
I am a senior undergraduate student, and a firm (moral) supporter of
Haskell, and am on the lookout for exciting places to do graduate
research. The areas of programming language design & implementation,
and of course the declarative paradigm, are of most interest. Would
anyone be able to sug
[ Apologies for multiple copies which are unavoidable. -Michael. ]
First Call for Papers/Abstracts/System descriptions
UNIF 2004
18th International Workshop on Unification
July 4-5, 2004, Cork, Ireland
ynomials!
>
>Jacques
>
>___
>Haskell mailing list
>[EMAIL PROTECTED]
>http://www.haskell.org/mailman/listinfo/haskell
>
>
Michael Manti
[EMAIL PROTECTED]
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
o <- force makeFoo `catch` \e -> defaultFoo
Thanks,
Michael
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
, Belgium
Wlodek Drabent Polish Academy of Sciences, Poland / Linkoeping Univ.,
Sweden
Gopal Gupta University of Texas at Dallas, USA
Michael Hanus University of Kiel, Germany (Chair)
Patricia Hill University of Leeds, UK
Andy King University of Kent, UK
Michael
, Belgium
Wlodek Drabent Polish Academy of Sciences, Poland / Linkoeping Univ.,
Sweden
Gopal Gupta University of Texas at Dallas, USA
Michael Hanus University of Kiel, Germany (Chair)
Patricia Hill University of Leeds, UK
Andy King University of Kent, UK
Michael
main conference web site
(http://www.icfpconference.org/)
Program Committee
-
* John Clements, California Polytechnic State University, United
States
* Matthew Flatt, University of Utah, United States
* Michael Hanus, University of Kiel, Germany
* Frank Huch, Unive
Please note that the deadline for the
Workshop on Functional and Declarative Programming in Education (FDPE08)
which will be held in conjunction with ICFP 2008 on Sunday, September
21, 2008 in Victoria, British Columbia, Canada is
extended to Sunday, June 29, 2008.
Beside regular papers
FYI there is precedent for this kind of thing in the functional programming world. PLT Scheme has a
Scheme mailing list and also a Scheme-in-education mailing list, which tackles the problems of
trying to teach Scheme to new programmers. If you start such a mailing list for Haskell, I'd like
t
much easier to
handle side-effecting computations.
Mike
Benjamin L.Russell wrote:
On Wed, 02 Jul 2008 00:58:08 -0700, Michael Vanier
<[EMAIL PROTECTED]> wrote:
FYI there is precedent for this kind of thing in the functional programming world. PLT Scheme has a
Scheme mailing list and also
idea how to make my code work?
I am using ghc 6.8.2 with
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleInstances #-}
Thanks,
Michael
___
Hello,
> So I hereby declare the official Haskell mascot to be the koala, in
> the form of the image attached below.
Is it possible to get a bigger version of this image to appropriately
identify the koala? ;-)
Kind regards,
Michael
--
Dipl.-Inf. Michael C. Lesniak
University of
2 | 14.97
| 4.63
Contributors:
* Simon Michael
* Tim Docker
* HAppS, happstack and testpack developers
Stats:
* Known errors: 0
* Commits: 132
* Committers: 2
* Tests: 56
* Non-test cod
, opening and searching. It is a
beta release, so you know what to expect there, and any bugs found can be
filed at http://trac.haskell.org/haskellfm .
Regards,
Michael
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
1 - 100 of 270 matches
Mail list logo