Commit 48f8a739 authored by Camil Staps's avatar Camil Staps 🚀

Add explanation for new `from .. import class ..(..())` construct (see...

Add explanation for new `from .. import class ..(..())` construct (see clean-compiler-and-rts/compiler#4)
parent 1c9a5360
Pipeline #20330 passed with stages
in 19 minutes and 51 seconds
......@@ -404,6 +404,11 @@ bs_import =
, "import code from \"tty.\" // Import functions from the object file matching 'Clean System Files/tty.*'"
, "import code from library \"msvcrt\" // Import functions from linked DLLs according to the msvcrt file in Clean System Files.\n" +
" // The file should start with the DLL name (e.g. msvcrt) and followed by one line per function you want to link."
] ++ map (add_imports ["StdEnv"] o EX)
[ "from StdMaybe import :: Maybe // Import only the type Maybe"
, "from StdMaybe import :: Maybe(..) // Import the type Maybe and all constructors"
, "from StdMaybe import :: Maybe(Just) // Import the type Maybe and the Just constructor"
, "from Data.Foldable import class Foldable(foldr1()) // Import the class Foldable and the foldr1 member type"
] ++ map (requires_itask_compiler o EX)
[ "import qualified Data.Map as M // Import Data.Map to use as e.g. 'M'.get (only supported by the iTask compiler)"
, "import Control.Monad => qualified join // Import Control.Monad except for join; join is imported qualified (only supported by the iTask compiler)"
......
......@@ -129,7 +129,7 @@ where
i -> trim (line % (0, i-1))
# doublecolon = indexOf "::" line
| doublecolon > 0
&& not (startsWith "generic " line || startsWith "class " line)
&& not (startsWith "generic " line || startsWith "class " line || startsWith "from " line)
// function without implementation
= case parseType [c \\ c <-: line & i <- [0..] | i > doublecolon+2] of
Just (Func is _ _) ->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment