I am new to haskell.
I am trying to do some "excersise" but i can't make anything work :(
This is my code.I replaced spaces with underscores ( _ )
Thanks for any suggestions or correctrions


import IO
import System
import List
import Maybe
import Char
import Numeric

type Name=String
type Room=Int
type Dr=String
type PatientTup=(Name,(Room,Dr))
type PatientList=[PatientTup]

main=do userText<-getText
----------------------------------------------------------------------------
-------
________getText::IO String
________getText=do nc<-getText
_______________________return (:nc)
----------------------------------------------------------------------------
-------
________PatientList::[(String,(Int,String))]
________PatientList=[("Robson, Brian",(2,"MJH")),
_____________________("Hitchin, Linda",(1,"ILR")),
_____________________("Reeve, Paul", (2,"ILR"))]
----------------------------------------------------------------------------
-------
________getWards::Int
________getWards PatientList=[Room | (Name,(Room,Dr)) <- PatientList,
Room==getText]
_________________do putSpc (length Room)
_________________return(RoomLength)
----------------------------------------------------------------------------
-------
________printFreq::WordList->IO()
________printFreq wl=do sequence (map putWards wl)
_________________________________where
______________________________________putWards::(getWards)->IO()
______________________________________putWards(w)=do putStr w
_____________________________________________________putChar '\n'
_____________________________________________________return(w)




_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
  • ... Γιώργος Κοσμίδης
    • ... Hal Daume III
    • ... Γιώργος Κοσμίδης
      • ... Malcolm Wallace
        • ... G?????? ??sµ?d??
          • ... Malcolm Wallace
            • ... G?????? ??sµ?d??
              • ... Hal Daume III

Reply via email to