runtasks
authorMart Lubbers <mart@martlubbers.net>
Fri, 21 Sep 2018 07:01:30 +0000 (09:01 +0200)
committerMart Lubbers <mart@martlubbers.net>
Fri, 21 Sep 2018 07:01:30 +0000 (09:01 +0200)
filepicker/prj [new file with mode: 0644]
filepicker/test.icl
filepickerbas/test.icl [new file with mode: 0644]
runtasks/test.dcl [new file with mode: 0644]
runtasks/test.icl [new file with mode: 0644]

diff --git a/filepicker/prj b/filepicker/prj
new file mode 100644 (file)
index 0000000..ff38448
--- /dev/null
@@ -0,0 +1,3 @@
+\e[?25l\e[J\e[J\e[J\e[J\e[J\e[J\e[34h\e[?25h\e[?1049h\e[?1h\e=\e[1;54r\e[23m\e[24m\e[0m\e[H\e[J\e[?25l\e[54;1H"Clean System Files" is a directory\e[2;1H\e[1m\e[34m~                                                                                                                                                                    \e[3;1H~                                                                                                                                                                    \e[4;1H~                                                                                                                                                                    \e[5;1H~                                                                                                                                                                    \e[6;1H~                                                                                                                                                                    \e[7;1H~                                                                                                                                                                    \e[8;1H~                                                                                                                                                                    \e[9;1H~                                                                                                                                                                    \e[10;1H~                                                                                                                                                                    \e[11;1H~                                                                                                                                                                    \e[12;1H~                                                                                                                                                                    \e[13;1H~                                                                                                                                                                    \e[14;1H~                                                                                                                                                                    \e[15;1H~                                                                                                                                                                    \e[16;1H~                                                                                                                                                                    \e[17;1H~                                                                                                                                                                    \e[18;1H~                                                                                                                                                                    \e[19;1H~                                                                                                                                                                    \e[20;1H~                                                                                                                                                                    \e[21;1H~                                                                                                                                                                    \e[22;1H~                                                                                                                                                                    \e[23;1H~                                                                                                                                                                    \e[24;1H~                                                                                                                                                                    \e[25;1H~                                                                                                                                                                    \e[26;1H~                                                                                                                                                                    \e[27;1H~                                                                                                                                                                    \e[28;1H~                                                                                                                                                                    \e[29;1H~                                                                                                                                                                    \e[30;1H~                                                                                                                                                                    \e[31;1H~                                                                                                                                                                    \e[32;1H~                                                                                                                                                                    \e[33;1H~                                                                                                                                                                    \e[34;1H~                                                                                                                                                                    \e[35;1H~                                                                                                                                                                    \e[36;1H~                                                                                                                                                                    \e[37;1H~                                                                                                                                                                    \e[38;1H~                                                                                                                                                                    \e[39;1H~                                                                                                                                                                    \e[40;1H~                                                                                                                                                                    \e[41;1H~                                                                                                                                                                    \e[42;1H~                                                                                                                                                                    \e[43;1H~                                                                                                                                                                    \e[44;1H~                                                                                                                                                                    \e[45;1H~                                                                                                                                                                    \e[46;1H~                                                                                                                                                                    \e[47;1H~                                                                                                                                                                    \e[48;1H~                                                                                                                                                                    \e[49;1H~                                                                                                                                                                    \e[50;1H~                                                                                                                                                                    \e[51;1H~                                                                                                                                                                    \e[52;1H~                                                                                                                                                                    \e[53;1H~                                                                                                                                                                    \e[1;1H\e[34h\e[?25h\e[?25l\e[0m\e[54;1H\e[1m-- VISUAL --\e[0m\e[54;13H\e[K\e[1;1H\e[34h\e[?25h\a\e[?25l\e[34h\e[?25h\e[?25l\e[34h\e[?25h\a\e[?25l\e[34h\e[?25h\e[?25l\e[34h\e[?25h\e[?25l\e[34h\e[?25h\e[?25l\e[54;1H\e[K\e[1;1H\e[34h\e[?25h\e[?25l\e[54;1HType  :qa!  and press <Enter> to abandon all changes and exit Vim\a\e[1;1H\e[34h\e[?25h\e[?25l\e[34h\e[?25h\e[?25l\e[34h\e[?25h\e[?25l\e[34h\e[?25h\a\a\e[54;1H\e[?1l\e>\e[?1049lVim: Error reading input, exiting...\r
+Vim: Finished.\r
+\e[54;1H\e[34h\e[?25h6 files to edit
index e3af2e6..a306d2c 100644 (file)
@@ -1,57 +1,8 @@
 module test
 
-import StdFunctions
-import System.Directory
-import System.File
-import System.FilePath
-import Data.List
-import Data.Functor
-import Data.Tree
-import qualified Control.Monad as CM
-import Control.Applicative
-import Control.Monad.Identity
-import Control.Monad.State
-import iTasks
+import iTasks.Extensions.Files
 
-derive class iTask RTree, FileInfo, Tm
-
-Start w = startEngine (selectFile "select a file" "/opt/clean") w
-
-selectFile :: !d !FilePath -> Task FilePath | toPrompt d
-selectFile d root = accWorld (createDirectoryTree root (Just 1)) >>= \tree->
-       withShared tree \stree->let numberedtree = mapRead numberTree stree in
-       withShared [] \ssel->
-       editSharedSelectionWithShared d False selOpt numberedtree ssel
-       -|| whileUnchanged (ssel >*< numberedtree) (\(sel, tree)->case sel of
-               [i] = case find ((==)i o fst) (leafs tree) of
-                       Just (i, (fp, Ok {directory=True}))
-                               = accWorld (createDirectoryTree fp (Just 1))
-                               @ flip (mergeIn i) tree
-                               >>= \newtree->set ([], newtree) (ssel >*< stree) @? const NoValue
-                       _ = unstable ()
-               _ = unstable ()
-       )
-       -|| viewSharedInformation "tree" [] (mapRead (drawRTree o fmap toSingleLineText) numberedtree)
-       @? tvHd
-       @ fst o snd
-where
-       mergeIn j newtree = foldTree \(i, t) cs->if (i == j) newtree (RNode t cs)
-
-       unstable a = treturn a @? \(Value a _)->Value a False
-
-       selOpt :: SelectOption (RTree (Int, (FilePath, MaybeOSError FileInfo))) (Int, (FilePath, MaybeOSError FileInfo))
-       selOpt = SelectInTree
-               (\tree->[{foldTree fp2cn tree & label=root}])
-               (\tree sel->[t\\t=:(i, _)<-leafs tree | isMember i sel])
-
-       fp2cn (i, (fp, mfi)) cs =
-               { id = i
-               , label=dropDirectory fp
-               , icon=Nothing
-               , expanded=True
-               , children=cs
-               }
-
-numberTree :: ((RTree a) -> RTree (Int, a))
-numberTree = flip evalState zero o foldTree \a cs->
-       (\lvs i->RNode (i, a) lvs) <$> 'CM'.sequence cs <*> getState <* modify inc
+Start w = startEngine (
+       selectFileTreeLazy "select a file" False "/opt/clean"
+       -&&- selectFileTree False "select a file" False "/opt/clean"[]
+       >&> viewSharedInformation "selection" []) w
diff --git a/filepickerbas/test.icl b/filepickerbas/test.icl
new file mode 100644 (file)
index 0000000..c77ef2a
--- /dev/null
@@ -0,0 +1,6 @@
+module test
+
+import iTasks
+import iTasks.Extensions.FileDialog
+
+Start w = startEngine (editFilePath "bork" (Action "Ok") (Just "/opt/clean")) w
diff --git a/runtasks/test.dcl b/runtasks/test.dcl
new file mode 100644 (file)
index 0000000..a102fe3
--- /dev/null
@@ -0,0 +1,6 @@
+definition module test
+
+class c c
+where
+       m1 :: c
+       m2 :: c
diff --git a/runtasks/test.icl b/runtasks/test.icl
new file mode 100644 (file)
index 0000000..e84c95e
--- /dev/null
@@ -0,0 +1,7 @@
+implementation module test
+
+class c c
+where
+       m1 :: c
+
+Start = 42