Re: (no subject)

2002-03-14 Thread Alastair David Reid


[EMAIL PROTECTED] writes:
 I am a student who study a computer programing.  I want to have
 Haskell software to study .  However, it is very hard to get
 the Haskell . and I hope you give me the way to get the Heskell.
 If you mail me to show the way to get the Heskell , I would
 appreciate your kindness. 

See http://haskell.org/hugs/ for an easily installed Haskell compiler.
It has version for Windows and Unix.

See http://haskell.org/implementations.html for other versions.

See http://haskell.org/ for lots of other information.

-- 
Alastair Reid[EMAIL PROTECTED]http://www.cs.utah.edu/~reid/
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Re: (no subject)

2002-02-24 Thread Hal Daume III

I'm not sure where the documentation is, but here's the idea on how to
used named fields.  I'll make a smaller example, though :)

 data T = T { x :: Int, y :: Bool }

now, to create a value of type T, you can write:

 x = T 5 True

as the datatype declaration creates the following function:

 T :: Int - Bool - T

You can also pattern match as if you had just declared it as data T = T
Int Bool.  However, this datatype declaration introduces two functions
into the namespace:

 x :: T - Int
 y :: T - Bool

which extract values.  for instance:

 x (T 5 True)

evaluates to 5 and

 y (T 5 True)

evaluates to True.

You can also use field names to create values:

 T { x = 5, y = True }

or

 T { y = True, x = 5}

order is irrelevant (i'm not sure about rules if you specify the same
field more than once...check in the report on that).

Finally, you can update parts of labelled fields independent of everything
else:

 let q = T {x=4, y=True}
 q' = q {x=5}
 in  q'

will yield T 5 True.

Of course, this isn't value replacement, it's just a more convenient way
to create a new value based on an old one, with minor changes.

I see Ashley also replied to this thread with a pointer to
documentation.  Hopefully the combination will help.

--
Hal Daume III

 Computer science is no more about computers| [EMAIL PROTECTED]
  than astronomy is about telescopes. -Dijkstra | www.isi.edu/~hdaume

On 25 Feb 2002, Tom Bevan wrote:

 
 
 Hi,
 
 I've come across this sort of data constructor below many times but I'm
 not really sure how to use it. Can someone please point me to the right
 section in the documentation?
 In particular, I want to know how to create a calendar time and how to
 access the fields .
 
 Tom
 
 data CalendarTime = CalendarTime {
   ctYear   :: Int,
   ctMonth  :: Month,
   ctDay, ctHour, ctMin, ctSec  :: Int,
   ctPicosec :: Integer,
   ctWDay:: Day,
   ctYDay   :: Int,
   ctTZName   :: String,
   ctTZ  :: Int,
   ctIsDST :: Bool
   } deriving (Eq, Ord, Read, Show)
 
 ___
 Haskell-Cafe mailing list
 [EMAIL PROTECTED]
 http://www.haskell.org/mailman/listinfo/haskell-cafe
 


___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Re: (no subject)

2001-12-10 Thread David Feuer

uma kompella wrote:
 
 hi
 
 i am new to haskell and am having a problem to write
 function which takes a boolean expression and returns
 a truthvalue stating whether or not it is a tautology.
 
 Can anyone please help me??
 
 Thanks a lot
 uma

I assume this is your homework.  It is better to say so explicitly.

Think about this:  what does it mean for an expression to be a
tautology?  Can you think of an a way to check this?  Once you've come
up with a way to check this, it should be quite easy to write it in
Haskell.
-- 
/Times-Bold 40 selectfont/n{moveto}def/m{gsave true charpath clip 72
400 n 300 -4 1{dup 160 300 3 -1 roll 0 360 arc 300 div 1 1 sethsbcolor
fill}for grestore 0 -60 rmoveto}def 72 500 n(This message has been)m
(brought to you by the)m(letter alpha and the number pi.)m(David Feuer)
m([EMAIL PROTECTED])m showpage

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Re: (no subject)

2001-12-10 Thread Ashley Yakeley

At 2001-12-10 16:07, uma kompella wrote:

i am new to haskell and am having a problem to write
function which takes a boolean expression and returns
a truthvalue stating whether or not it is a tautology.

If you really want to impress your tutor, see if you can find a function 
that does this in polynomial time.

-- 
Ashley Yakeley, Seattle WA


___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Haskell -- Java was Re: (no subject)

2000-11-24 Thread Erik Meijer

Have a look at http://www.mondrian-script.org 

Erik

- Original Message - 
From: "Chris Angus" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 24, 2000 1:44 AM
Subject: (no subject)


 I was wondering if 
 Has anybody had access to a Haskell - Java compiler/translator.
 
 -
 Chris Angus
 Armature
 Enterprise House
 1 Apex View
 Leeds LS11 9BH
 +44 113 2595253
 [EMAIL PROTECTED]
 
 ___
 Haskell-Cafe mailing list
 [EMAIL PROTECTED]
 http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Re: Haskell -- Java was Re: (no subject)

2000-11-24 Thread Nigel Perry

Sorry folks the Haskell compiler at http://www.mondrian-script.org 
doesn't produce Java, yet...

Actually the compiler *does* produce Java but it has been turned off 
as there is no Haskell Prelude for Java yet, that bit is currently 
only for .NET. We'll produce such a Java Prelude when we get the 
time, no promises as to when at present - .NET is our first priority 
at the moment. (For the technically minded the GHC Prelude is a mix 
of Haskell and C, its getting the C stuff converted for JVM/.NET 
which takes the time.)

However there is a Mondrian compiler on the site which does produce 
Java, so maybe that will do you in the meantime.

At 8:48 am -0800 24/11/00, Erik Meijer wrote:
Have a look at http://www.mondrian-script.org

Erik

- Original Message -
From: "Chris Angus" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 24, 2000 1:44 AM
Subject: (no subject)


  I was wondering if
   Has anybody had access to a Haskell - Java compiler/translator.
-- 
--
Dr Nigel PerryEmail: [EMAIL PROTECTED]
IIST  Tel: +64 6 350 5799 2477
Massey University Fax: +64 6 350 2259
Palmerston North  FTP/WWW: smis-asterix.massey.ac.nz
New Zealand

It makes as much sense to wear a "cycle" style helmet in a car as on a bike...
Choosing to wear one on a bike but not in a car is mere inconsistency.
Refusing to wear one in a car while insisting others do so on a bike 
is pure hypocrisy.

Will the new Labour government repeal the National government's hypocrisy,
or will they discriminate against cyclists like their predecessors?

Politics and hypocrisy before safety - the NZ Helmet Law, NZ's Shame

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe