tandard scoping restriction as for existential
types? (Which they basically are, as we know.) Why do you consider it
troublesome?
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
think with the scoping restrictions in place the beta rule would not
be affected.
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
[EMAIL PROTECTED] wrote:
>
> I'm afraid I may disagree about the quantification. Also, I'm cautious
> about the phrase "ML and Haskell". In GHC 6.4, local type variables
> behave pretty much like those in ML (actually, GHC 6.2 was closer). In
> GHC 6.6, the behavior is completely different!
>
> Reg
;t understand what you mean. Polymorphism is about typing. Late
binding is not dependent on typing (there are untyped OO languages, for
example).
Cheers,
- Andreas
[Followups to Haskell Cafe]
--
Andreas Rossberg, [EMAIL PROTECTED]
Let's get rid of those possible thingies! --
ss function"). In typical
functional programming style, you need the general thing only rarely.
Cheers,
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
Let's get rid of those possible thingies! -- TB
___
Haskell mailing list
Haskell@haskell
hat many Germans rather tend to say
"die Kind" instead when they have to, maybe because that is the gender
you have for "Sorte", "Art", and "Gattung".
--
Andreas Rossberg, [EMAIL PROTECTED]
Let's get rid of those possible thingies! -- TB
_
se f at all (well, except with undefined). The type is
not polymorphic in "a" on the RHS, it is abstract! You'd need to
encapsulate a value of the same type (or a constructing function) as
well to this type useful.
--
Andreas Rossberg, [EMAIL PROTECTED]
Let's get rid of tho
gt;() without a being
quantified. That looks a bit more uniform in the face of MPTCs and would
allow more programs, because contexts induced by dead code in form of an
unused declaration could be forgotten consistently, not just when some
of its free variables happen to be bound by a
a where fc :: a -> a -> ()
c1 x = let p = fc x in ()
c2 x = let p y = fc x y in ()
where
c1 :: C a => a -> ()
c2 :: C a => a -> ()
is inferred, as I would expect.
--
Andreas Rossberg, [EMAIL PROTECTED]
Let's get rid of those possible thingies! -- TB
_
rincipal type (due
to the lack of row polymorphism), so its type must be derivable from
context - which might involve a type annotation.
BTW, I'd prefer r.l as well. A section like (.l) could then give you the
equivalent of #l.
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
Let'
Andreas Rossberg, [EMAIL PROTECTED]
Let's get rid of those possible thingies! -- TB
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
es would go to "\t" and " ", which your algorithm would
reject.
If the editor does the replacement consistently everywhere (like I would
expect) then it would not change the meaning of a "well-indented" program.
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
e that.
With this solution, tab width is irrelevant and indentation may include
whatever Unicode has.
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
"Computer games don't affect kids; I mean if Pac Man affected us
as kids, we would all be running around in darkened rooms, munching
rse, for most practical programs, the optimization you have in
mind would be possible. I doubt compilers generally do it globally,
though, because it requires whole program analysis, i.e. does not
interfer well with separate compilation (beside other reasons).
| Andreas
--
Andreas Rossberg, [EMA
ent
classify :: [Classifier a] -> [a] -> [[a]]
Cheers,
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
"Computer games don't affect kids; I mean if Pac Man affected us
as kids, we would all be running around in darkened rooms, munching
magic pills, and l
this example it is easy to infer how to transform arbitrary
recursive definitions. Even generalising it to mutual recursion is not
difficult (and left as an exercise to the reader ;-).
All the best,
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
"Computer games don't affect ki
tance Num T where
fromInteger n = T n
(+) (T _) (T _) = T 0
x :: T -- try removing this type signature
x = 1 + 2
main = putStr (show x)
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
"Computer games don't affect kids.
If Pac Man affected us as kids, we w
it. To me it seems overly restrictive to rule out
perfectly correct programs for the sole reason of potentially surprising
space/time behaviour. After all it is not forbidden to write Haskell
programs with obscure space leaks.
--
Andreas Rossberg, [EMAIL PROTECTED]
"Computer games don't
iting
> type T = Row [] Int
Cheers,
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
"Computer games don't affect kids.
If Pac Man affected us as kids, we would all be running around in
darkened rooms, munching pills, and listening to repetitive music."
___
ymorphically recursive
functions. Wasn't this one motivation to allow general polymorphic
recursion in Haskell - that it is in the language anyway?
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
"Computer games don't affect kids.
If Pac Man affected us as kids, we would all be
/www.cs.chalmers.se/~rjmh/
Hope this helps,
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
"Computer games don't affect kids.
If Pac Man affected us as kids, we would all be running around in
darkened rooms, munching pills, and listening to repetitive music."
___
is potentially
infinite.
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
"Computer games don't affect kids.
If Pac Man affected us as kids, we would all be running around in
darkened rooms, munching pills, and listening to repetitive music."
_
}
This can be reformulated as
io_l2'= do { l <- return 14
; () <- putStr "qq"
; l <- return 14
; () <- putStr "ww"
; l <- return 14
; () <- putStr "qq"
I mumbled:
>
> This is not a legal type expression, since Tree is a
> type constructor, not a ground type, so you cannot apply it to the list
> constructor.
The other way round, of course: you cannot apply the list constructor to
it.
- Andreas
--
Andreas Rossberg, [EMA
a Tree a = N a (Forest a) deriving (Ord,Eq,Show)
> data Forest a = Forest [Tree a]
> instance Xy Forest Char where
> test (Forest (N a xs:txs)) = a
HTH,
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
:: be declarative. be functional. just be. ::
___
e classes, which I
wouldn't call overloading in the first place.) BTW, this sort of
notational overloading used in maths has always been a good source of
confusion for students, IMHO.
All the best,
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
:: be declarative. be functional. just be. ::
s come in handy sometimes (eg. for
unification) -- like always.
Compilers like OCaml or SML/NJ are very fast, even though they have to
perform quite some complex stuff. And they are `mostly functional'.
(And please: not another flame war about the definition of
`functional'.)
-
Kevin Atkinson wrote:
>
> On Tue, 5 Oct 1999, George Russell wrote:
>
> > Perhaps I'm being stupid. (It certainly wouldn't be the first time!)
> > But what does OO give me that I can't get with existential types (in
> > datatype definitions) and multiparameter type classes? The latter seem
> >
accordingly might be possible with
MPTCs, I think. The hard problem is that you cannot establish equalities
like
Prod a (Quot b a) = b
Sigh.
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
:: be declarative. be functional. just be. ::
-- OK: Quot Metres Seconds
a = m /$ (s *$ s) -- OK: Quot Metres (Prod Seconds Seconds)
x = m -$ s -- error
It would be nicer if Haskell had infix type constructors:
newtype a :* b = Prod Float
newtype a :/ b = Quot Float
Cheers,
kell's,
because I couldn't get Yacc's error productions to work properly in all
cases).
For Haskell 2(000) I would suggest removing all but the first 4 tokens
from the list above.
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
:: be declarative. be functional. just be. ::
haracter matching for -}. (Modulo nesting, as now.)
Sorry for interrupting, but how are inner comments opened then? By
character by character matching for {- ? So is this legal
{- bla {-- blabla -} bla -}
?
Regards,
- Andreas
--
Andreas Rossberg, [EMAIL PROTECTED]
:: be declarative. be functional. just be. ::
Frank A. Christoph wrote:
>
> >Standard ML does not allow this. One important aspect of the SML module
> >system actually is its strong separation from the core language.
>
> Not that old saw again...! Ocaml separates the two as well.
Well, the new let-module feature undermines the separation
Frank A. Christoph wrote:
>
> Local imports might be useful, though. Objective Caml 2.00 has finally
> caved in and followed Standard ML in allowing expression-local modules.
Standard ML does not allow this. One important aspect of the SML module
system actually is its strong separation from th
Ralf Hinze wrote:
>
>* make '_' lexically a valid identifier character anywhere
>* but disallow identifiers starting with '_'
>
> Thus '___' would lex as '___' but then be rejected. '_' on its own remains a
> wild-card pattern, and illegal in expressions.
>
>
> ] `_' is a special case w
Simon L Peyton Jones wrote:
>
> GHC 3.02 supports multi-parameter type classes, but I have been
> guilty of not documenting precisely what that means.
>
> I've now summarised the extensions, informally but I hope
> precisely, at
>
> http://www.dcs.gla.ac.uk/multi-param.html
That does n
Hello,
thinking about whether the pretty printer proposed by Wadler requires
some changes to be efficient in a strict language, I stumbled over the
the last case defining `flatten':
flatten (x :<|> y) = flatten x
I wonder why it is necessary here to recurse on x. The only point were a
Tommy Thorn wrote:
>
> Koen Claessen:
> > This brings us to another issue. Doesn't the following definition look
> > a bit awkward?
> >
> > R{ x = x }
>
> Definitely wierd. The left and right-hand side denotes two different
> things, which AFAIK is the only place where `=' behaves like this.
38 matches
Mail list logo