Assignment 10

Moderator: Konzepte der Programmiersprachen

tud_informatik
Neuling
Neuling
Beiträge: 4
Registriert: 17. Nov 2018 17:44

Assignment 10

Beitrag von tud_informatik » 30. Jan 2019 17:57

I just read the solution of Assignment 10 and I can't understand this sentence

subset :: (Eq a, Collection c1, Collection c2) => c1 a -> c2 a -> Bool
subset c1 c2 = and $ map(\e -> hasElem e c2) $ allElem c1


in the last sentence, where is the second operand for AND operation?

I understand it like this : and ( map( function )( list ) )

a10r
Erstie
Erstie
Beiträge: 11
Registriert: 4. Nov 2012 13:53

Re: Assignment 10

Beitrag von a10r » 31. Jan 2019 13:32

This particular and function only takes one argument. See here for the documentation.
It takes some foldable container of bools and calculates AND over all elements in it.

Antworten

Zurück zu „Konzepte der Programmiersprachen“