mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-20 18:21:47 +03:00
18 lines
407 B
Idris
18 lines
407 B
Idris
module Main
|
|
|
|
import System.File
|
|
import Data.String
|
|
import Data.List1
|
|
import Data.List
|
|
|
|
parse : String -> Maybe String
|
|
parse x = case forget $ split (\c => c == ' ' || c == '(') x of
|
|
"function" :: name :: _ => Just name
|
|
_ => Nothing
|
|
|
|
main : IO ()
|
|
main = do
|
|
Right res <- readFile "build/exec/app.js" | Left err => printLn err
|
|
let fns = mapMaybe parse $ lines res
|
|
printLn $ fns \\ nub fns
|