[Haskell-cafe] Producing MinimumValue

Sebastian Sylvan sebastian.sylvan at gmail.com
Wed Jul 18 17:24:22 EDT 2007


On 18/07/07, Alexteslin <alexteslin at yahoo.co.uk> wrote:
>
> Hello,
>
> I am trying to define a function as part of the exercises that gives a
> result of a minimum value of the input list of ints. Such as this:
>
> minimumValue :: [Int] -> Int
> minimumValue ns ...
>
> using either filter or map functions but Not foldr1, because the exercise
> precedes the section on foldr1.
> I am confused because using filter - it generates a list on some constraint
> function for each element.
>
> Any hints will be very appreciated.  Thank you

Are you allowed to use primitive recursion?

minimumValue [x] = x
minimumValue (x:xs) = ... -- exercise!


-- 
Sebastian Sylvan
+44(0)7857-300802
UIN: 44640862


More information about the Haskell-Cafe mailing list