File: Main.agda

package info (click to toggle)
agda-stdlib 2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,196 kB
  • sloc: haskell: 375; makefile: 32; sh: 28; lisp: 1
file content (18 lines) | stat: -rw-r--r-- 384 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# OPTIONS --guardedness #-}

module Main where


open import Data.List.Base using (replicate)
open import Data.String using (toList; fromList)

open import IO
open import Function.Base using (_$_)

open import TakeWhile

main : Main
main = run $ List.sequence′ $ replicate 3 $ do
  str ← getLine
  let taken = takeWhile lower? (toList str)
  putStrLn $ fromList (taken .prefix)