The Haskell 98 Report contains the following example, in section 7.2 on
page 89:
main = readFile "input-file" >>= \ s ->
writeFile "output-file" (filter isAscii s) >>
putStr "Filtering succesful\n"
I am just learning Haskell, and this seemed extre
From: Theo Norvell <[EMAIL PROTECTED]>
>See http://www.engr.mun.ca/~theo/Publications/indExamp.lgs
>for three versions. The simplest is just
>
>> p 0 n = n+1
>> p (m+1) 0 = p m 1
>> p (m+1) (n+1) = p m (p (m+1) n)
Thanks! =)
Of course it was so simple that I couldn't figure it out.
On Thu, 18 Nov 1999, Wayne Young wrote:
> I'm still getting the syntax correct (playing with simple functions,
> etc) and was wondering how I would define Ackermann's function in
> Haskell.
See http://www.engr.mun.ca/~theo/Publications/indExamp.lgs
for three versions. The simplest is just
>
Greets,
Sorry to intrude (new to both the list and to Haskell).
I'm still getting the syntax correct (playing with simple functions,
etc) and was wondering how I would define Ackermann's function in
Haskell. I'm curious to see how Haskell (using Hugs) will outperform C
and Pascal for th
Jeffrey R. Lewis" <[EMAIL PROTECTED]> wrote:
>
> Anyway, the only thing missing now in the above proposal
> is a similar flexibility with contexts.
> Say, you want `b' to be a bound, and thus use :<=,
> but you want the context to be exact
> (i.e. you don't want extra context elements to be
Starting from Jeffrey R. Lewis' <[EMAIL PROTECTED]> wish to
let partial type declarations express binding of SOME type variables
> > foo :: C a => a -> _b
and modulating the syntax proposed by Claus Reinke <[EMAIL PROTECTED]>,
> > foo :<= C a => a -> b
I suggested the following notat
Patrik Jansson:
> I like ? better than .., but maybe the Haskell "don't care"-symbol _
> could be even more suggesting:
>
> q :: a -> _ -> c
> qa_ = c
>
> Syntactically this is closer to what is currently allowed as type
> variables and it would easily (in the sense that such a pro
Wolfram Kahl wrote:
> Jeffrey R. Lewis" <[EMAIL PROTECTED]> writes:
> >
> > foo :<= C a => a -> b roughly equiv to foo :: C _a => _a -> _b
> >
> > I can easily imagine that you might want some variables to be a bound, and
> > others to be exact, as in
> >
> > foo :: C a =>
To my last message:
> Jeffrey R. Lewis" <[EMAIL PROTECTED]> writes:
> >
> > foo :<= C a => a -> b roughly equiv to foo :: C _a => _a -> _b
> >
> > I can easily imagine that you might want some variables to be a bound, and
> > others to be exact, as in
> >
> > foo
Jeffrey R. Lewis" <[EMAIL PROTECTED]> writes:
>
> foo :<= C a => a -> b roughly equiv to foo :: C _a => _a -> _b
>
> I can easily imagine that you might want some variables to be a bound, and
> others to be exact, as in
>
> foo :: C a => a -> _b
>
> I don't think the
Claus Reinke wrote:
>
> what I wanted to write was
> a partial specification, which I would want to write as
>
> foo :<= C a => a -> b
>
> Read e :<= t as "the type of e should be bounded by t". Choose a better
> symbol if you like -- the idea is to keep the syntax of types unchanged,
> and to
>Koen Claessen wrote:
>> We should allow "partial type specification". The programmer is
>> allowed to specify as much information about the type as (s)he wants.
>>
>> The partial type specification would be taken as a "skeleton",
>> merely filled in by the type inference algorithm.
>> foo ::
On Wed, 17 Nov 1999, Koen Claessen wrote:
> foo :: (..) => a -> b -> c
This is certainly something I've been bitten by.
I like ? better than .., but maybe the Haskell "don't care"-symbol _
could be even more suggesting:
q :: a -> _ -> c
qa_ = c
Syntactically this is closer to w
13 matches
Mail list logo