aboutsummaryrefslogtreecommitdiff
path: root/src/Hiking.hs
diff options
context:
space:
mode:
authorJoris2019-03-10 19:15:45 +0100
committerJoris2019-03-10 19:15:45 +0100
commit8e03a571033a5d02d2287a2b1d1edd8b57aa2462 (patch)
tree03d6965bb65322dbac03edf2d6a30ee856c197f6 /src/Hiking.hs
parentc41f16ed474376ad8a61a75d8b7f9ef543f359b4 (diff)
Scrap result page and make a CSV of it
Diffstat (limited to 'src/Hiking.hs')
-rw-r--r--src/Hiking.hs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/Hiking.hs b/src/Hiking.hs
new file mode 100644
index 0000000..2d04b4f
--- /dev/null
+++ b/src/Hiking.hs
@@ -0,0 +1,42 @@
+module Hiking (Hiking(..), header, values) where
+
+import Data.Text
+import qualified Data.Text as T
+
+data Hiking = Hiking
+ { name :: Text
+ , description :: Text
+ , lat :: Text
+ , lng :: Text
+ , url :: Text
+ , duration :: Text
+ , distance :: Text
+ , elevation :: Text
+ , difficulty :: Text
+ } deriving (Eq, Show)
+
+header :: [Text]
+header =
+ [ "name"
+ , "lat"
+ , "lng"
+ , "link"
+ , "durée"
+ , "distance"
+ , "dénivelé"
+ , "color"
+ , "infos"
+ ]
+
+values :: Hiking -> [Text]
+values h =
+ [ name h
+ , lat h
+ , lng h
+ , url h
+ , duration h
+ , distance h
+ , elevation h
+ , difficulty h
+ , description h
+ ]