Search results

Jump to navigation Jump to search
  • instance (Applicative m) => Applicative (ReaderT r m) where ... instance (Alternative m) => Alternative (ReaderT r m) where ...
    3 KB (378 words) - 15:19, 6 February 2021
  • countLeaves (Branch _ l r) = countLeaves l + countLeaves r
    331 bytes (43 words) - 13:38, 25 December 2016
  • foldl :: (a -> x -> r) -> a -> [x] -> r foldl :: (a -> x -> r) -> a -> [x] -> r
    5 KB (891 words) - 14:21, 3 January 2018
  • atLevel (Branch v l r) n | n > 1 = atlevel l (n-1) ++ atlevel r (n-1)
    741 bytes (125 words) - 13:40, 25 December 2016
  • go mgu (Var l) r | not (r `contains` Var l) = Just $ (l, r) : mgu go mgu l (Var r) | not (l `contains` Var r) = Just $ (r, l) : mgu
    2 KB (410 words) - 11:26, 13 February 2019
  • layoutAux x y sep (Branch a l r) = (layoutAux (x+sep) (y+1) (sep `div` 2) r)
    2 KB (299 words) - 03:42, 10 January 2017
  • preorder (Branch x l r) = x : preorder l ++ preorder r inorder (Branch x l r) = inorder l ++ x : inorder r
    2 KB (280 words) - 03:43, 10 January 2017
  • So <hask>r = render ["fr", "pt"]</hask> will do the right thing. You just need to pass this <hask>r</hask> around in your code.
    2 KB (354 words) - 03:41, 14 August 2021
  • add x t@(Branch y l r) = case compare x y of LT -> Branch y (add x l) r
    741 bytes (117 words) - 22:03, 23 April 2021
  • <hask>L-T-R</hask> gives * <hask> (show L) ++ (show T ++ (show R)) </hask>
    3 KB (421 words) - 16:40, 1 August 2018
  • f (1, x) r = x : r f (k, x) r = x : f (k-1, x) r
    2 KB (362 words) - 17:33, 13 June 2020
  • f x r a@(Just q) | x == q = r a f x r _ = x : r (Just x)
    3 KB (454 words) - 15:07, 2 October 2020
  • new = fmap (\r -> Cons (writeIORef r) (readIORef r)) . newIORef new = fmap (\r -> Cons (writeSTRef r) (readSTRef r)) . newSTRef
    2 KB (338 words) - 20:04, 13 May 2020
  • Or using the slightly more verbose (w.r.t. <hask>(&&&)</hask>) Applicative combinators: f x r (Just a@(i,q)) | x == q = r (Just (i+1,q))
    3 KB (470 words) - 03:45, 19 May 2021
  • Given a binary tree as the usual Prolog term t(X,L,R) (or nil). As a preparation for drawing the tree, a layout algorithm is req layoutAux x y (Branch a l r) = (Branch (a, (x',y)) l' r', x'')
    2 KB (337 words) - 03:41, 10 January 2017
  • hbaltree x h = [Branch x l r | l <- hbaltree x hl, r <- hbaltree x hr]
    1 KB (215 words) - 13:38, 25 December 2016
  • leaves' (Branch _ l r) xs = leaves' l $ leaves' r xs
    615 bytes (90 words) - 13:39, 25 December 2016
  • insert k v (IMap xs) = insert' $ viewl r (l,r) = split (>= Key k undefined) xs
    2 KB (315 words) - 15:19, 6 February 2021
  • diff_select' n xs = do r <- randomRIO (0,(length xs)-1) let remaining = take r xs ++ drop (r+1) xs
    2 KB (244 words) - 00:09, 7 April 2019
  • reverseTree (Branch x l r) = Branch x (reverseTree r) (reverseTree l)
    666 bytes (91 words) - 13:37, 25 December 2016
  • ...<code>Bool</code>, for instance. Then a function of type <code>(t -> r) -> r</code>, is like a box which takes a question about a value of type <code>t< newtype Cont r t = Cont ((t -> r) -> r)
    7 KB (1,253 words) - 23:34, 25 June 2021
  • cbalTree n = let (q, r) = (n - 1) `quotRem` 2 in [Branch 'x' left right | i <- [q .. q + r],
    4 KB (694 words) - 01:23, 7 June 2021
  • range l r = scanl (+) l (replicate (l - r) 1) range l r = scanl op l $ replicate diff 1
    1 KB (214 words) - 02:08, 5 April 2014
  • removeAt k (x:xs) = let (a, r) = removeAt (k - 1) xs in (a, x:r) removeAt n (x:xs) = (l, x:r)
    2 KB (340 words) - 11:56, 26 April 2016
  • where (l, t', r) = layoutAux x1 1 t layoutAux x y (Branch a l r) = (ll', Branch (a, (x,y)) l' r', rr')
    4 KB (637 words) - 03:42, 10 January 2017
  • ...internals' (Branch x l r) xs = (x :) $ internals' l $ internals' r xs
    717 bytes (98 words) - 13:39, 25 December 2016
  • ...this string representation, if the tree is given as usual (as nil or t(X,L,R) term). Then write a predicate which does this inverse; i.e. given the stri treeToString (Branch x l r) =
    2 KB (372 words) - 03:43, 10 January 2017
  • ...20). Below, I set up the array <hask>r</hask> for exactly that, with <hask>r!0</hask> forced to <hask>True</hask> to bootstrap the whole thing. buyable n = r!n
    6 KB (929 words) - 06:42, 21 November 2020
  • <br /><hask>u :: Empty -> r</hask> <br /><hask>u :: r -> ()</hask>
    7 KB (1,086 words) - 10:33, 9 March 2023
  • symmetric (Branch _ l r) = mirror l r
    1 KB (179 words) - 13:36, 25 December 2016
  • ...en2 -bg '#324c80' -fg '#adbadd' -e '' -ta l -w 400 -fn '-misc-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*'" ...| dzen2 -e '' -x 400 -w 880 -ta r -fg $FG -bg $BG -fn '-misc-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*' &
    2 KB (236 words) - 00:49, 27 January 2018
  • Left l, Right r -> l + r ModDur (Tempo r) d -> d / r
    3 KB (470 words) - 23:09, 11 July 2021
  • filled (Branch _ l r) = [True] : zipWith (++) (filled l) (filled r)... (r, xss'') = cbt xss'
    9 KB (727 words) - 03:41, 10 January 2017
  • foldr (\p r -> p*p > n || ((n `rem` p) /= 0 && r)) | r == 0 = p : go q ps
    4 KB (605 words) - 17:09, 18 July 2022
  • uncompress t x = let (r,_) = runState (bar t) x in r do r <- baz
    8 KB (1,072 words) - 18:32, 16 January 2017
  • countNodes (Branch _ l r) = countNodes l + countNodes r + 1 baltree h n = [Branch x l r |
    3 KB (407 words) - 13:38, 25 December 2016
  • where rand = do r <- randomRIO (0, (length xs) - 1) return (xs!!r)
    4 KB (666 words) - 13:03, 10 May 2014
  • r x = fromJust . find ((== x) . snd) $ t putStrLn . unwords . map fst . head . sort . map (sort . map r) . sol $ n
    1 KB (177 words) - 22:56, 5 April 2021
  • class Resturi r where x :: r -> r
    4 KB (586 words) - 15:17, 6 February 2021
  • ...ient function phi(m) is defined as the number of positive integers r (1 <= r < m) that are coprime to m.
    1 KB (224 words) - 19:44, 18 January 2014
  • ...bject <math>A</math> of <math>\mathcal{C}</math> to <math>R^{\mathcal{C}(A,R)}</math> corresponding to the CPS monad in Haskell.
    3 KB (547 words) - 07:53, 16 April 2019
  • tree2ds (Branch x l r) = x:(tree2ds l ++ tree2ds r)
    3 KB (285 words) - 03:44, 10 January 2017
  • | y == x = let (f,r) = getReps ys in (y:f, r)
    2 KB (347 words) - 21:03, 20 December 2018
  • rec p <- newIORef (Node 0 r) r <- newIORef (Node 1 p)
    10 KB (1,757 words) - 23:34, 24 July 2021
  • newtype ContT r m a ...type <hask>a</hask> and a final result of type <hask>r</hask>. The <hask>r</hask> type can be polymorphic most of the time. You only need to specify
    12 KB (2,067 words) - 05:43, 9 March 2021
  • *<code>C-c C-r</code> reload current Haskell interpreter session ...>C-c C-l</code> to load the file. Then, you can go on to type <code>C-c C-r</code> (or simply <code>C-c C-l</code> again) to reload the current module
    2 KB (358 words) - 18:22, 11 April 2016
  • ChurchList { runList :: forall r. (a -> r -> r) -> r -> r }
    4 KB (693 words) - 13:33, 15 April 2024
  • f :: forall %r. () -> () -> Int %r Remember that the <hask>forall %r</hask> at the front of the type is supposed to indicate that the return val
    3 KB (472 words) - 04:20, 8 June 2023
  • instance ParseTree ('Down c ': 'Up ': r) ('Node c '[]) r instance ParseForest ('Down d ': is) (t ': ts) r
    7 KB (1,025 words) - 02:14, 23 July 2021
  • = do r <- getStdRandom (randomR (1,prob)) let curr' = if r == 1 then orig else (next:curr)
    6 KB (855 words) - 12:54, 26 June 2017
  • :* LSE = <code>(\(!_) -> r) (part u)</code> :* RSE = <code>(\(!_) -> r) u</code>
    13 KB (2,108 words) - 12:52, 1 January 2024
  • Right r -> case runDRMonad (f r) s' of type MCPS a = forall r. Cont (M r) a
    6 KB (995 words) - 23:51, 16 April 2021
  • | r == 0 = p : pf ps q where (q, r) = n `divMod` p
    8 KB (1,054 words) - 15:53, 11 October 2015
  • regular n k | r == 1 || n <= k || n < 0 || k < 0 = [] (q, r) = (n * k) `quotRem` 2
    2 KB (388 words) - 03:47, 10 January 2017
  • regexBool r l = l =~ r :: Bool -- simple boolean regex matching
    6 KB (842 words) - 05:27, 8 February 2016
  • where helper left right@(r:rs) n | otherwise = helper (r:left) rs (n - 1)
    3 KB (452 words) - 21:07, 10 March 2019
  • lift2 :: (a -> b -> r) -> (Pair a -> Pair b -> Pair r) ...adFix</hask> and <hask>MonadReader</hask> instance for the type <hask>(->) r</hask>. The <hask>liftM</hask> (see below) functions of this [[monad]] are
    7 KB (1,165 words) - 20:40, 31 October 2019
  • data Cxt a = Top | L (Cxt a) (Tree a) | R (Tree a) (Cxt a) ...was <code>t</code> and whose parent had context <code>c</code>. The <code>R</code> constructor is similar. <code>Top</code> represents the top of a tre
    10 KB (1,623 words) - 21:10, 26 June 2023
  • ...this way we can create instances such as <hask> Forall r Show => Show (Rec r) </hask>. This is available to the application programmer as well. ...h corresponding label) to existing records. Suppose we have a record <hask>r = { x = 0, y = 0 }</hask>. If we have an extensible record system we can th
    25 KB (4,073 words) - 08:53, 9 December 2013
  • foldr (\p r -> p*p > k || k `rem` p /= 0 && r)
    3 KB (432 words) - 07:06, 11 May 2016
  • , Run Com "uname" ["-s","-r"] "" 36000
    1,023 bytes (104 words) - 15:18, 6 February 2021
  • 1:p:candidates = [6*k+r | k <- [0..], r <- [1,5]] roll (Wheel n rs) = [n*k+r | k <- [0..], r <- rs]
    18 KB (2,583 words) - 20:08, 19 December 2020
  • depth (Node _ l r) = 1 + max (depth l) (depth r) ...<hask>_</hask>). The left branch is named <hask>l</hask>, the right <hask>r</hask>, allowing us to use these values in the right hand side.
    6 KB (1,060 words) - 16:51, 18 June 2021
  • ==R==
    8 KB (1,251 words) - 05:43, 1 September 2022
  • <haskell>(forall a. (t a -> r)) ≅ ((exists a. t a) -> r)</haskell> perimeter (Circle r) = 2 * pi * r
    13 KB (2,093 words) - 10:57, 25 October 2023
  • : hold-sell dup float+ f@ close f@ f* deposit >r 0e r> f! ; ( addr -- )
    3 KB (433 words) - 15:17, 6 February 2021
  • == N-R ==
    4 KB (637 words) - 02:02, 6 May 2024
  • r <- liftIO (newIORef 0) (next r `mplus` next r >> next r `mplus` next r) >> next r `mplus` next r
    13 KB (2,036 words) - 13:54, 4 July 2023
  • Success r >>= k = k r catch (Success r) _ = Success r
    10 KB (1,404 words) - 06:22, 22 January 2020
  • idCPS :: a -> (a -> r) -> r mysqrtCPS :: a -> (a -> r) -> r
    10 KB (1,560 words) - 12:02, 15 April 2024
  • ...rep1&type=pdf Performing Lisp Analysis of the FANNKUCH Benchmark], Kenneth R. Anderson and Duane Rettig (27KB PDF) (# s, r# #) -> case setcount c# r# s of
    22 KB (3,539 words) - 00:49, 14 December 2016
  • * /r/haskell
    1 KB (165 words) - 01:05, 12 January 2017
  • cont r n d = m : rest m = (truncate (sqrt (fromIntegral r)) + n) `div` d
    6 KB (979 words) - 10:20, 18 May 2022
  • instance MonadExit e (ReaderT r (Exit e)) where instance Monad m => MonadExit e (ReaderT r (ExitT e m)) where
    4 KB (707 words) - 09:43, 9 December 2014
  • showresp r doc body = case r of
    4 KB (517 words) - 04:59, 26 April 2021
  • > type R = Other R0 > testS = eval (bot :: S P Q R) :: App (App P R) (App Q R)
    10 KB (1,653 words) - 00:25, 12 July 2021
  • snap v origin step = if r==0 then v else v+(step-r) where r = rem (v-origin) step -- NB: origin <= v ; else use MOD
    5 KB (696 words) - 19:46, 18 January 2014
  • arc(u,r). digraph([r,s,t,u,v],[a(s,r),a(s,u),a(u,r),a(u,s),a(v,u)])
    11 KB (1,679 words) - 06:20, 11 June 2023
  • instance (MonadRandom m) => MonadRandom (ReaderT r m) where instance (MonadReader r m, RandomGen g) => MonadReader r (RandT g m) where
    6 KB (894 words) - 13:41, 2 April 2019
  • runUO g = let !(# _, r #) = runRW# (useUO# (g . UO)) in r !r = g h
    11 KB (1,656 words) - 22:33, 4 July 2022
  • diff -r cdaa1062e534 config.h diff -r cdaa1062e534 config.mk
    7 KB (986 words) - 15:19, 6 February 2021
  • check (Node i l r) = i + check l - check r check (Node i l r) = i + check l - check r
    6 KB (1,055 words) - 23:27, 18 April 2020
  • , Run Com "uname" ["-s","-r"] "" 36000
    2 KB (189 words) - 01:17, 9 April 2021
  • showsEquation (l, r) = showsExprPrec 0 l . showString " = " . showsExprPrec 0 r
    5 KB (621 words) - 15:30, 8 June 2017
  • ?- remove_at(X,[a,b,c,d],2,R). R = [a,c,d]
    5 KB (839 words) - 04:58, 10 June 2023
  • putStr $ unlines [ "Starting thread for range " ++ show r | r <- ranges ]
    4 KB (555 words) - 10:58, 22 June 2021
  • ...xK_i), raiseMaybe (runInTerm "-title Irssi" "sh -c 'screen -A -r irssi'") (title ~? "Irssi")) ...xK_r), raiseMaybe (runInTerm "-title rtorrent" "sh -c 'screen -A -r rtorrent'") (title =? "rtorrent"))
    6 KB (615 words) - 23:47, 28 November 2018
  • minus (lft@(CharCount c1 i1):xs) r@((CharCount c2 i2):ys) | (c1 < c2) = do rem <- xs `minus` r
    2 KB (256 words) - 15:19, 6 February 2021
  • > Right r -> r > Right r -> return r
    11 KB (1,437 words) - 00:04, 1 September 2017
  • *** A set <math>R</math> *** A unary operation <math>- : R \to R</math>
    13 KB (2,245 words) - 15:18, 6 February 2021
  • ...gular expressions where not applicable for this task, e.g. they used other r.e. grammars or ...ng ''w'' is a word of a given regular set (given by a regular expression ''r'')
    22 KB (3,425 words) - 22:34, 29 June 2021
  • > instance AddHyp (Gamma ((T2T t) :*: hs)) r gamma > => AddHyp (Gamma hs) (t :*: r) gamma where
    20 KB (3,458 words) - 15:19, 6 February 2021
  • nfibs n = let r = replicate (n-1) 0 ++ 1 : 1 : zipWith ((-).(2*)) (drop n r) r in r
    8 KB (1,150 words) - 15:41, 5 July 2022
  • | [[Programming performance/KrassiVanguelov R]] | R
    4 KB (638 words) - 23:08, 5 April 2021
  • -- r and a natural number k, the decimal expansion of r^k terminates if -- and only if the decimal expansion of r does.
    15 KB (2,018 words) - 01:29, 26 April 2021
  • # <tt>chmod -R go-rwx /home/newuser</tt>
    2 KB (246 words) - 08:59, 9 June 2023
  • justDoc (Just (d,r,x)) = stripResult (fromJSON x) justDoc (Just (d,r,x)) = stripResult (fromJSON x)
    12 KB (1,556 words) - 15:19, 6 February 2021
  • -- Another argument, tagged with R because it is :*: M1 S NoSelector (K1 R (UserTree a))
    16 KB (2,615 words) - 20:24, 19 October 2020
  • ...epository.readscheme.org/ftp/papers/sw2004/shan.pdf</ref>; moreover, <ref> R. Kent Dybvig, Simon Peyton-Jones, and Amr Sabry. "A Monadic Framework for -- i.e the "rest" of the computation, to a final result of type r.
    35 KB (5,673 words) - 20:05, 7 July 2015
  • serialize (Branch l r) = [(x, '1':code) | (x, code) <- serialize r]
    5 KB (738 words) - 19:53, 18 January 2014

View (previous 100 | next 100) (20 | 50 | 100 | 250 | 500)