From 6db8c821dcb36f34ae8ecb652ed4e063a70dfd40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Hurlin?= Date: Tue, 15 Oct 2024 09:48:34 +0200 Subject: [PATCH] Few tweaks after delivering course 5, and be more precise in TP3 --- slides/course-04.md | 2 +- tps/TP3.hs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/slides/course-04.md b/slides/course-04.md index a103cbd..b0a992d 100644 --- a/slides/course-04.md +++ b/slides/course-04.md @@ -491,7 +491,7 @@ data Authenticated -- @type@ defines aliases (shortcuts) type UserWithAuthStatus a = User -authenticate' :: User -> String -> UserWithAuthStatus Authenticated +authenticate' :: User -> String -> Either String (UserWithAuthStatus Authenticated) authenticate' = undefined ``` diff --git a/tps/TP3.hs b/tps/TP3.hs index 181d0c2..0da5e68 100644 --- a/tps/TP3.hs +++ b/tps/TP3.hs @@ -18,8 +18,8 @@ main = do -- 1/ Define a type representing URLs you can enter in a browser address bar, -- i.e. strings of the form: -- - http://www.google.fr --- - google.fr --- - reddit.com/r/haskell +-- - https://github.com/dmjio/miso/pulls +-- - http://reddit.com/r/haskell -- 2/ Write a parser from String to your URL type. Its return type must be -- Either String MyType. The 'Left' case is the error message. Write tests. -- 3/ We now want to do URL filtering, to grant/forbid access to an URL @@ -38,4 +38,5 @@ main = do -- 5/ Generalize your filter: allow them to be whitelist, i.e. an URL -- passes the filter only if matches the filter. Write tests. -- --- Use https://hoogle.haskell.org/ to find the functions you need \ No newline at end of file +-- Use https://hoogle.haskell.org/ to find the functions you need, for example splitOn: +-- https://hackage.haskell.org/package/split-0.2.5/docs/Data-List-Split.html#v:splitOn \ No newline at end of file