aboutsummaryrefslogtreecommitdiff
path: root/Inotify.icl
diff options
context:
space:
mode:
Diffstat (limited to 'Inotify.icl')
-rw-r--r--Inotify.icl17
1 files changed, 10 insertions, 7 deletions
diff --git a/Inotify.icl b/Inotify.icl
index fcd1d60..c07377d 100644
--- a/Inotify.icl
+++ b/Inotify.icl
@@ -92,29 +92,32 @@ where
check :: [(Int,Int,String)] (INWatch, INCallback st) *(*Inotify st, *World)
-> *(*Inotify st, *World)
check infos (watch,f) (st,w)
- # (st,w) = seq [\(st,w) -> f mask (toMaybe name) st w
- \\ (wd,mask,name) <- infos | wd == watch] (st,w)
+ # (st,w) = seq
+ [ \(st,w) -> f mask (toMaybe name) st w
+ \\ (wd,mask,name) <- infos
+ | wd == watch
+ ]
+ (st,w)
= (st,w)
where
toMaybe :: String -> Maybe String
- toMaybe s = if (s=="") Nothing (Just s)
+ toMaybe s = if (size s==0) Nothing (Just s)
bytesToInt :: {#Char} -> Int
bytesToInt cs = sum [toInt c << p \\ c <-: cs & p <- [0,8..]]
split :: Int String -> [String]
split n s
- | size s > n = [s % (0,n-1) : split n (s % (n, size s - 1))]
+ | size s > n = [s % (0,n-1) : split n (s % (n, size s - 1))]
| size s == n = [s]
- | s == "" = []
+ | size s == 0 = []
splitOn :: Char String -> [String]
splitOn c s = map toString (split` c [c \\ c <-: s])
where
split` :: Char [Char] -> [[Char]]
split` c [] = []
- split` c cs=:[x:xs]
- = let (l,r) = span ((<>)c) cs in [l:split` c (removeMember c r)]
+ split` c cs=:[x:xs] = [l:split` c r] where (l,[_:r]) = span ((<>)c) cs
c_check :: !Int -> (!Bool, !String, !String, !String, !Int)
c_check fd = code {