[Haskell-beginners] Typing/N00b question/My first haskell.

Alia alia_khouri at yahoo.com
Mon Nov 21 11:49:47 CET 2011


The key function is to_int below:


<snip>

module Main where

ageJudge :: (Integral a) => a -> String
ageJudge age
    | age >= 40 = "You're too old!"
    | age <= 30 = "Your too young"
    | otherwise   = "Not in the programming age range.."

to_int s = read s :: Int


eg = ageJudge (to_int "40")

</snip>



More information about the Beginners mailing list