FP Laboratory 10

From Marek Běhálek Wiki
Revision as of 12:05, 18 September 2019 by Beh01 (talk | contribs)
Jump to navigation Jump to search

Abstract data types

  • Create an abstract data type Stack with following functions:
push :: a -> Stack a -> Stack a
pop :: Stack a -> Stack a
top :: Stack a -> a
isEmpty :: Stack a ->Bool
  • Create an abstract data type Queue with following functions:
isEmpty :: Queue a -> Bool
addQ :: a -> Queue a -> Queue a
remQ :: Queue q -> (a, Queue a)