|| || || || || || ||__ Hugs 98: Based on the Haskell 98 standard ||___|| ||__|| ||__|| __|| Copyright (c) 1994-2003 ||---|| ___|| World Wide Web: http://haskell.org/hugs || || Report bugs to: hugs-bugs@haskell.org || || Version: Nov 2003 _______________________________________________ Hugs mode: Restart with command line option +98 for Haskell 98 mode Type :? for help Prelude> :l example ERROR - Unable to open file "example" Prelude> :l example.hs ERROR - Unable to open file "example.hs" Prelude> :l examples ERROR "examples.hs":25 - Syntax error in declaration (unexpected symbol "==") Prelude> :r ERROR "examples.hs":60 - Syntax error in type expression (unexpected `}', possibly due to bad layout) Prelude> :r ERROR "examples.hs":44 - "remove" multiply defined Prelude> :r ERROR "examples.hs":69 - Undefined type constructor "OrdererdPair" Prelude> :r ERROR "examples.hs":35 - Undefined variable "longMonthts" Prelude> :r ERROR "examples.hs":49 - Type error in explicitly typed binding *** Term : merge *** Type : [Int] -> [Int] -> [Int] *** Does not match : [Int] -> [Int] -> Int Prelude> :r Main> quicksort [3,5,2,7,5,8,1,9,4] [2,1,3,5,7,5,8,9,4] Main> :r Main> quicksort [3,5,2,7,5,8,1,9,4] [1,2,3,4,5,7,8,9] Main> union [2,1,3,5,7,5,8,9,4] longMonths [2,1,3,5,7,5,8,9,4,10,12] Main> intersect [2,1,3,5,7,5,8,9,4] longMonths [1,3,5,7,5,8] Main> :l graph Main> search [6,3,2,1] Main> :l freecell Main> search [(0,[[],[],[]],[8,8]),(8,[[],[],[]],[8,7]),(8,[[],[7],[]],[8,6]),(8,[[],[6,7],[]],[8,5]),(8,[[5],[6,7],[]],[8,4]),(8,[[5],[6,7],[4]],[8,3]) ,(8,[[5],[7],[6,4]],[8,3]),(8,[[],[7],[5,6,4]],[8,3]),(8,[[7],[],[5,6,4]],[8,3]),(0,[[7],[],[8,5,6,4]],[8,3]),(0,[[],[],[7,8,5,6,4]],[8,3]) ,(3,[[],[],[7,8,5,6,4]],[8,2]),(3,[[2],[],[7,8,5,6,4]],[8,1]),(3,[[2],[1],[7,8,5,6,4]],[8,0]),(3,[[2],[7,1],[8,5,6,4]],[8,0]),(3,[[],[2,7,1 ],[8,5,6,4]],[8,0]),(0,[[],[3,2,7,1],[8,5,6,4]],[8,0]),(0,[[8],[3,2,7,1],[8,5,6,4]],[7,0]),(0,[[8],[3,2,7,1],[7,8,5,6,4]],[6,0]),(0,[[8],[3 ,2,7,1],[6,7,8,5,6,4]],[5,0]),(5,[[8],[3,2,7,1],[6,7,8,5,6,4]],[4,0]),(5,[[8],[4,3,2,7,1],[6,7,8,5,6,4]],[3,0]),(5,[[8],[3,4,3,2,7,1],[6,7, 8,5,6,4]],[2,0]),(5,[[8],[2,3,4,3,2,7,1],[6,7,8,5,6,4]],[1,0]),(5,[[1,8],[2,3,4,3,2,7,1],[6,7,8,5,6,4]],[0,0]),(5,[[6,1,8],[2,3,4,3,2,7,1], [7,8,5,6,4]],[0,0]),(5,[[7,6,1,8],[2,3,4,3,2,7,1],[8,5,6,4]],[0,0]),(5,[[7,6,1,8],[3,4,3,2,7,1],[2,8,5,6,4]],[0,0]),(0,[[5,7,6,1,8],[3,4,3, 2,7,1],[2,8,5,6,4]],[0,0]),(0,[[3,5,7,6,1,8],[4,3,2,7,1],[2,8,5,6,4]],[0,0])] Main> head [2,1,3,5,7,5,8,9,4] 2 Main> tail [2,1,3,5,7,5,8,9,4] [1,3,5,7,5,8,9,4] Main> last [2,1,3,5,7,5,8,9,4] 4 Main> init [2,1,3,5,7,5,8,9,4] [2,1,3,5,7,5,8,9] Main> [2,1,3,5,7,5,8,9,4] !! 4 7 Main> concat [ [1,4,5], [2,3], [6,4,2,5] [] [1] ] ERROR - Type error in application *** Expression : [6,4,2,5] [] [1] *** Term : [6,4,2,5] *** Type : [d] *** Does not match : a -> b -> c Main> concat [ [1,4,5], [2,3], [6,4,2,5], [], [1] ] [1,4,5,2,3,6,4,2,5,1] Main> unzip ["ab ERROR - Improperly terminated string Main> unzip [ ("abc","de"), ("fg","i"), ("jk","lm") ] (["abc","fg","jk"],["de","i","lm"]) Main>