/
wildzes
/
LearnMyHaskell
Обзор
Документация
Войти
/
wildzes
/
LearnMyHaskell
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
HaskellProgrammingFFP/Madness.hs
30 строк
857 B
WildZes
Everythink in HaskellProgrammingFFP was checked and working. Exercise 4_6_9 in Strpik folder unfinished
14 мар 2020, 00:27
14 мар 2020, 00:27
45efaf5
Код
Авторство
О чём код?
--Chapter 15 --Monoid, Semigroup --Now you’re going to refactor this code a bit! Rewrite it using mconcat. --Original code import Data.Monoid type Verb = String type Adjective = String type Adverb = String type Noun = String type Exclamation = String madlibbin' :: Exclamation -> Adverb -> Noun -> Adjective -> String madlibbin' e adv noun adj = e <> "! he said " <> adv <> " as he jumped into his car " <> noun <> " and drove off with his " <> adj <> " wife." --Exercise madlibbinBetter' :: Exclamation -> Adverb -> Noun -> Adjective -> String madlibbinBetter' e adv noun adj = mconcat [e, "! he said ", adv, " as he jumped into his car ", noun, " and drove off with his ", adj, " wife."]