Difference between revisions of "Help talk:Contents"

From HaskellWiki
Jump to navigation Jump to search
Line 7: Line 7:
 
Variable are as followed:
 
Variable are as followed:
   
type KeyNum = Int {- unique id -}
+
type KeyNum = Int {- unique id -}
type Station = String {- Station Name -}
+
type Station = String {- Station Name -}
type Interchange = String {- Interchange stations -}
+
type Interchange = String {- Interchange stations -}
type DurMins = Int {- Duration Mins -}
+
type DurMins = Int {- Duration Mins -}
type DurSecs = Int {- Duration Secs -}
+
type DurSecs = Int {- Duration Secs -}
type Database = [ (KeyNum, Station, Interchange, DurMins, DurSecs)] {- Record Structure -}
+
type Database = [ (KeyNum, Station, Interchange, DurMins, DurSecs)] {- Record Structure -}
   
 
right.. now when i try and enter data into the Database i get the following error
 
right.. now when i try and enter data into the Database i get the following error
   
ERROR file:.\HaskellSample1.hs:20 - Syntax error in declaration (unexpected `::')
+
ERROR file:.\HaskellSample1.hs:20 - Syntax error in declaration (unexpected `::')
   
 
Now on line 20 the code is doing the following:
 
Now on line 20 the code is doing the following:
   
TrainTimes :: Database
+
TrainTimes :: Database
   
 
now according to the haskell book i have.. this should all be fine.. but for some reason it is erroring on me.
 
now according to the haskell book i have.. this should all be fine.. but for some reason it is erroring on me.

Revision as of 22:06, 21 February 2006

Hi i am studying a degree in games computing in lincoln UK.. and i have been given an assignment to create a program in C, C++, Haskell, and prolog..

I have jsut got on to haskell, and am having some real difficulty with it.. and was hoping that someone could help me out with this.

Now i am sure that this isnt the page that i'm meant to put stuff like this, but it might be somewhere that someone checks and might see..

Variable are as followed:

type KeyNum = Int		{- unique id -}			
type Station = String		{- Station Name -}
type Interchange = String	{- Interchange stations -}
type DurMins = Int		{- Duration Mins -}
type DurSecs = Int		{- Duration Secs -}
type Database = [ (KeyNum, Station, Interchange, DurMins, DurSecs)]		{- Record Structure -}

right.. now when i try and enter data into the Database i get the following error

ERROR file:.\HaskellSample1.hs:20 - Syntax error in declaration (unexpected `::')

Now on line 20 the code is doing the following:

TrainTimes :: Database

now according to the haskell book i have.. this should all be fine.. but for some reason it is erroring on me.

If you have any clues, and can help me please can you contact me on the following email address.

Neil_farmeruk@yahoo.co.uk

All help will be greatly appreciated..

Neil Farmer

A much better idea is to ask on the Haskell Cafe --Neil Mitchell 22:05, 21 February 2006 (UTC)