Hi,_______________________________________________maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> aits in the Data.ListMay 22, 2020 8:33:33 PM CEST "Daniel van de Ghinste (Lord_Luvat)" <danielvandeghinste@gmail.com> wrote:Hi,Maybe I’m on a different version, but I don’t see a function called maximumBy in my base Prelude. Can you give us a type signature for the function? If you’re not sure how to do that just type:Prelude> :t maximumByIn your ghci interpreter and it should return the type signature of whatever you have after ‘:t ‘ (this works for compound expressions too if you put them in brackets)Perhaps maximumBy is what you’re meant to call your rewrite of the existing function I see called ‘maximum’ (seems to do the same thing). Let me know if thats the case and I can explain how it works.Best regards,Daniel van de GhinsteOn 22 May 2020, at 20:20, Alexander Chen <alexander@chenjia.nl> wrote:Hi,_______________________________________________I want to re-write a function maximumBy (its an assignment).However, I don't get how it works.>maximumBy compare [1,53,9001, 10]9001but what does it actually do to get there?thanks in advance.best,
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners