_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
c6ff440f10767ba6bbe3c0da7387ec604293533b26dbe20d16168d8ea8baa609 | neongreen/haskell-ex | Main.hs | import Data.List
moving :: Int -> [Double] -> [Double]
moving _ [] = []
moving n list
| n <= 0 = list
|otherwise = map average movingList
where
average :: [Double] -> Double
average xs = sum xs / genericLength xs
movingList :: [[Double]]
movingList = map move $ tail $ inits list
where... | null | https://raw.githubusercontent.com/neongreen/haskell-ex/345115444fdf370a43390fd942e2851b9b1963ad/week3/average/alviprofluvium/Main.hs | haskell | import Data.List
moving :: Int -> [Double] -> [Double]
moving _ [] = []
moving n list
| n <= 0 = list
|otherwise = map average movingList
where
average :: [Double] -> Double
average xs = sum xs / genericLength xs
movingList :: [[Double]]
movingList = map move $ tail $ inits list
where... | |
54443fa1b7bce6cdefac7daa16b723491527d9b30a60cfaf050867f2c1a27330 | tweag/ormolu | inline-out.hs | foo :: Int -> Int
foo = id
# INLINE foo #
# INLINE [ 2 ] bar #
bar :: Int -> Int
bar = id
baz :: Int -> Int
baz = id
# INLINE [ ~2 ] baz #
reVector :: Bundle u a -> Bundle v a
# INLINE reVector #
reVector = M.reVector
| null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/declaration/signature/inline/inline-out.hs | haskell | foo :: Int -> Int
foo = id
# INLINE foo #
# INLINE [ 2 ] bar #
bar :: Int -> Int
bar = id
baz :: Int -> Int
baz = id
# INLINE [ ~2 ] baz #
reVector :: Bundle u a -> Bundle v a
# INLINE reVector #
reVector = M.reVector
| |
cc827032e475a6c325a231c5ef9202383af0ddbcf47f746cf6b44bdfc0308050 | mzp/coq-for-ipad | glArray.ml | $ I d : glArray.ml , v 1.6 2008/10/30 07:51:33 garrigue Exp $
open Gl
open Raw
type kind = [`edge_flag | `texture_coord | `color | `index | `normal | `vertex ]
let check_static func f raw =
if not (Raw.static raw) then
invalid_arg ("GlArray." ^ func ^ " : buffer must be static");
f raw
external _edge_flag... | null | https://raw.githubusercontent.com/mzp/coq-for-ipad/4fb3711723e2581a170ffd734e936f210086396e/src/ocaml-3.12.0/otherlibs/lablGL/glArray.ml | ocaml | $ I d : glArray.ml , v 1.6 2008/10/30 07:51:33 garrigue Exp $
open Gl
open Raw
type kind = [`edge_flag | `texture_coord | `color | `index | `normal | `vertex ]
let check_static func f raw =
if not (Raw.static raw) then
invalid_arg ("GlArray." ^ func ^ " : buffer must be static");
f raw
external _edge_flag... | |
6835dcdc62473eabdfe1441fc58f60285d18047f4d231174e8f1f50fb9a43038 | pflanze/chj-schemelib | monadic-load-tree.scm | (include "monad.scm")
(define (loaded+loading loaded loading)
(vals loaded loading))
(define loadstate-loaded val0)
(define loadstate-loading val1)
(define (m:load-tree mod loadstate)
(delay
(let ((sym (val0 mod)))
(cond ((memq sym (loadstate-loading loadstate))
(raise-source-error (val1 mod) "ci... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/mod/monadic-load-tree.scm | scheme | ref, how.
perhaps keep code?XX
loading ourselves:
loaded ourselves: | (include "monad.scm")
(define (loaded+loading loaded loading)
(vals loaded loading))
(define loadstate-loaded val0)
(define loadstate-loading val1)
(define (m:load-tree mod loadstate)
(delay
(let ((sym (val0 mod)))
(cond ((memq sym (loadstate-loading loadstate))
(raise-source-error (val1 mod) "ci... |
a787ebeae9431b18c0f6ccf0bb2080cf5198456b68d6ae1d2e8688cb1ddcda23 | serras/cobalt | OutsideIn.hs | # LANGUAGE ScopedTypeVariables #
module Cobalt.OutsideIn (
Gathered(..)
, UseSystemFTypes(..)
, gDefn
, gDefns
, tcDefn
, tcDefns
, Solution(..)
, solve
, entails
, simpl
, toSolution
) where
import Control.Lens hiding ((.=))
import Control.Lens.Extras
import Data.Maybe (mapMaybe)
import Control.Monad.Except
import ... | null | https://raw.githubusercontent.com/serras/cobalt/cd8df75581a320fcca0d7d11b4b8c1788e8a5f9c/src/Cobalt/OutsideIn.hs | haskell | import Debug.Trace
| Gather constrains from a definition
Add the annotated type to the environment
| Gather constraints from a list of definitions | # LANGUAGE ScopedTypeVariables #
module Cobalt.OutsideIn (
Gathered(..)
, UseSystemFTypes(..)
, gDefn
, gDefns
, tcDefn
, tcDefns
, Solution(..)
, solve
, entails
, simpl
, toSolution
) where
import Control.Lens hiding ((.=))
import Control.Lens.Extras
import Data.Maybe (mapMaybe)
import Control.Monad.Except
import ... |
d027511ebc97ad9c01d9e9e6e71e9739b540a3d837a91f8c564985781a843f8b | jlongster/schemeray | scm-debug.scm |
(define (breakpoint . rest)
(command-loop (make-condition 'Breakpoint rest)))
| null | https://raw.githubusercontent.com/jlongster/schemeray/0ea0f1596cbafa05e541131fd64d482c79dd4173/ports/prescheme/scm-debug.scm | scheme |
(define (breakpoint . rest)
(command-loop (make-condition 'Breakpoint rest)))
| |
e9f84d2e734084a207ed22ffeccd8912a6242edfa1ea0dde83c24e3135b5efe7 | cpeikert/ALCHEMY | LinearCyc.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
{-# LANGUAGE TypeFamilies #-}
# LANGUAGE TypeFamilyDependencies #
module Crypto.Alchemy.Language.LinearCyc where
import Crypto.Alchemy.Language.Lambda
import ... | null | https://raw.githubusercontent.com/cpeikert/ALCHEMY/adbef64576c6f6885600da66f59c5a4ad91810b7/src/Crypto/Alchemy/Language/LinearCyc.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
| Constraints needed to linear
| 'Cyc' wrapper for the input to linearCyc_
| An object-language expression representing the given linear function. | # LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
# LANGUAGE TypeFamilyDependencies #
module Crypto.Alchemy.Language.LinearCyc where
import Crypto.Alchemy.Language.Lambda
import Crypto.Lol
import GHC.Exts (Constraint)
| Symantics for... |
558f9281e16dc046b9af702bfa98842ffdd2dbbcfe0e3ba91a4681597ffe183d | etorreborre/registry | DynamicSpec.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# OPTIONS_GHC -fno - warn - deprecations #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Test.Data.Registry.Internal.DynamicSpec where
import Data.Dynamic
import Data.Registry.Internal.Dynamic
import Data.Registry.Internal.Types
import Data.Te... | null | https://raw.githubusercontent.com/etorreborre/registry/117e66b1bed3dda1901f406a5c8a7bd8a61e736e/test/Test/Data/Registry/Internal/DynamicSpec.hs | haskell | no value is returned when an input parameter is incorrect
no value is returned when there are not enough inputs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# OPTIONS_GHC -fno - warn - deprecations #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Test.Data.Registry.Internal.DynamicSpec where
import Data.Dynamic
import Data.Registry.Internal.Dynamic
import Data.Registry.Internal.Types
import Data.Te... |
22b9470f8a792ddf9225ecd378c26646a7bf79ed229725b7daab0ed33745209b | ggeoffrey/cljs-gravity | proxy.cljs | (ns gravity.force.proxy
(:require [gravity.tools :refer [log warn err]]))
(defn send
"Send a message to a given worker.
arg worker : worker to target
arg flag : a string (or keyword) that the worker can map to an action
arg data : an object to send (optionnal)"
([worker flag]
(.postMessage worker (clj->... | null | https://raw.githubusercontent.com/ggeoffrey/cljs-gravity/21f15aa08e88d747bc6dbe356a31c7d4d35d0bb9/src/gravity/force/proxy.cljs | clojure | (ns gravity.force.proxy
(:require [gravity.tools :refer [log warn err]]))
(defn send
"Send a message to a given worker.
arg worker : worker to target
arg flag : a string (or keyword) that the worker can map to an action
arg data : an object to send (optionnal)"
([worker flag]
(.postMessage worker (clj->... | |
4340d3476f582c5e16fe67a00409a4cd867372d9a92b1a3fbddbf6d4cb67258e | mbj/stratosphere | JsonProperty.hs | module Stratosphere.SageMaker.MonitoringSchedule.JsonProperty (
JsonProperty(..), mkJsonProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data JsonProperty
= Js... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/sagemaker/gen/Stratosphere/SageMaker/MonitoringSchedule/JsonProperty.hs | haskell | module Stratosphere.SageMaker.MonitoringSchedule.JsonProperty (
JsonProperty(..), mkJsonProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data JsonProperty
= Js... | |
be4b7cf2d35a907f6fd1eda69670dbe7ee6e31ead491e378dc96f87b867c3172 | WorksHub/client | tag_selector_cards.cljs | (ns workspaces.tag-selector-cards
(:require [nubank.workspaces.card-types.react :as ct.react]
[nubank.workspaces.core :as ws]
[reagent.core :as r]
[wh.components.tag-selector.tag-selector :as tag-selector]))
(def tags [{:weight 0.029,
:subtype "software",
... | null | https://raw.githubusercontent.com/WorksHub/client/a51729585c2b9d7692e57b3edcd5217c228cf47c/client/src/workspaces/tag_selector_cards.cljs | clojure | (ns workspaces.tag-selector-cards
(:require [nubank.workspaces.card-types.react :as ct.react]
[nubank.workspaces.core :as ws]
[reagent.core :as r]
[wh.components.tag-selector.tag-selector :as tag-selector]))
(def tags [{:weight 0.029,
:subtype "software",
... | |
03a8cb622d6c7a5a3caabf9eee7a825a702fd8bdc7ba968e073bfb991fe77cb6 | tfausak/exercism-solutions | difference-of-squares_test.hs | import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..))
import System.Exit (ExitCode(..), exitWith)
import Squares (sumOfSquares, squareOfSums, difference)
exitProperly :: IO Counts -> IO ()
exitProperly m = do
counts <- m
exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 el... | null | https://raw.githubusercontent.com/tfausak/exercism-solutions/5e6f93979cc61ef5e3b48a09ca316dfd7fcd319c/haskell/difference-of-squares/difference-of-squares_test.hs | haskell | To add a little extra challenge, these functions should work with any
instance of the Integral typeclass. | import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..))
import System.Exit (ExitCode(..), exitWith)
import Squares (sumOfSquares, squareOfSums, difference)
exitProperly :: IO Counts -> IO ()
exitProperly m = do
counts <- m
exitWith $ if failures counts /= 0 || errors counts /= 0 then ExitFailure 1 el... |
3ed441cfe62fc432f2a04bc72c09c4871f4a80a9a139c8c7d5420a4e25aee2e1 | MagnusS/okra | lint.mli |
* Copyright ( c ) 2021 < >
* Copyright ( c ) 2021 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE... | null | https://raw.githubusercontent.com/MagnusS/okra/aac577076a2fc39fcd27fca339d463fb10d324ca/src/lint.mli | ocaml | * [lint_string_list] is like {!lint} except the input is a list of lines |
* Copyright ( c ) 2021 < >
* Copyright ( c ) 2021 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE... |
6bda53e13de4106874001538b3f39d88957ce4bd8cc8a290a44b34042816c568 | esobchenko/probix | probix_time.erl | -module(probix_time).
-compile(export_all).
%% We were obliged to write the own format for timestamps, since the standard {Date, Time}
format is not applicable for fractional seconds and timezone handling .
-include("probix.hrl").
there are no Erlang functions for the unix epoch , but there are functions
for g... | null | https://raw.githubusercontent.com/esobchenko/probix/d4c955bafb47b20eae0e8ce32bde705bb3a9f72b/src/probix_time.erl | erlang | We were obliged to write the own format for timestamps, since the standard {Date, Time}
timezone
fraction seconds to parsing timezone
separator between date
separators between date and time
separator between time parts
separators of fractional part
parsing date
parsing time
parsing fraction by character, caus... | -module(probix_time).
-compile(export_all).
format is not applicable for fractional seconds and timezone handling .
-include("probix.hrl").
there are no Erlang functions for the unix epoch , but there are functions
for gregorean epoch in Erlang 's calendar module . We will use this
offset to convert grigorea... |
0f6ddbecbdaf8beb8c8f4c3b614be8bb43db2aaf20d1744250205e631b7d8a2b | docker-in-aws/docker-in-aws | form_resources.cljs | (ns swarmpit.component.service.form-resources
(:require [material.icon :as icon]
[material.component :as comp]
[material.component.form :as form]
[swarmpit.component.parser :refer [parse-int parse-float]]
[swarmpit.component.state :as state]
[sablono.core :r... | null | https://raw.githubusercontent.com/docker-in-aws/docker-in-aws/bfc7e82ac82ea158bfb03445da6aec167b1a14a3/ch16/swarmpit/src/cljs/swarmpit/component/service/form_resources.cljs | clojure | (ns swarmpit.component.service.form-resources
(:require [material.icon :as icon]
[material.component :as comp]
[material.component.form :as form]
[swarmpit.component.parser :refer [parse-int parse-float]]
[swarmpit.component.state :as state]
[sablono.core :r... | |
759dd15960f69ee1b4f53f6d7d581394d9749516ac4f4876589d8d3a794d90b5 | bobzhang/fan | regress2.ml | class map =
object (o : 'self_type)
method string : string -> string = o#unknown
method list :
'a_out 'a .
('self_type -> 'a -> 'a_out) -> 'a list -> 'a_out list =
fun _f_a ->
function
| [] -> []
| _x::_x_i1 ->
let _x = _f_a... | null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/todoml/test/printer/regress2.ml | ocaml | class map =
object (o : 'self_type)
method string : string -> string = o#unknown
method list :
'a_out 'a .
('self_type -> 'a -> 'a_out) -> 'a list -> 'a_out list =
fun _f_a ->
function
| [] -> []
| _x::_x_i1 ->
let _x = _f_a... | |
811932112db2ab35b9ef62dcc13e866dba4cbb2878bd90d863026a91e0a42de0 | quephird/fun-with-quil | spinny_rings.clj | (ns fun-with-quil.animations.spinny-rings
(:require [quil.core :as q]
[quil.middleware :as m]))
(def screen-w 800)
(def screen-h 800)
(defn setup []
(q/smooth)
(q/no-fill)
(q/ellipse-mode :center)
(q/background 0)
(q/stroke 255)
(q/stroke-weight 3))
(defn dashed-circle [x y r]
(let [dash-... | null | https://raw.githubusercontent.com/quephird/fun-with-quil/3b3a6885771f5a1a4cffeb8379f05a28048a1616/src/fun_with_quil/animations/spinny_rings.clj | clojure | (ns fun-with-quil.animations.spinny-rings
(:require [quil.core :as q]
[quil.middleware :as m]))
(def screen-w 800)
(def screen-h 800)
(defn setup []
(q/smooth)
(q/no-fill)
(q/ellipse-mode :center)
(q/background 0)
(q/stroke 255)
(q/stroke-weight 3))
(defn dashed-circle [x y r]
(let [dash-... | |
7cd6cc6b74805ee004b4c2727f723bdbc3052ea3ce6381fd306cadee45a58fe7 | pjones/xmonadrc | Columns.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE InstanceSigs #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
-- |
--
-- Copyright:
-- This file is part of the package xmonadrc. It is subject to the
-- license terms in the LICENSE file found in th... | null | https://raw.githubusercontent.com/pjones/xmonadrc/c19f77f3a2625a24d1b7fb623bcdde3a241bc508/src/XMonad/Local/Layout/Columns.hs | haskell | |
Copyright:
This file is part of the package xmonadrc. It is subject to the
license terms in the LICENSE file found in the top-level
directory of this distribution and at:
No part of this package, including this file, may be copied,
modified, propagated, or distributed except according to the
te... | # LANGUAGE FlexibleInstances #
# LANGUAGE InstanceSigs #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module XMonad.Local.Layout.Columns
( Columns,
IncMasterCol (..),
TileFlow (..),
IncLayoutN (..),
mkCols,
)
where
... |
1665bfed35b229308ad3e2a32f710bd87e4061e3dd80e91ab58d77d6f5f4b339 | emillon/ocaml-noise | private_key.ml | type t = Private of Cstruct.t [@@deriving eq]
let pp fmt _ = Format.pp_print_string fmt "<private key>"
let bytes (Private cs) = cs
let of_bytes cs = Private cs
| null | https://raw.githubusercontent.com/emillon/ocaml-noise/d5a3e0f634fba1f8d948a91c70a1dad6470722b0/lib/private_key.ml | ocaml | type t = Private of Cstruct.t [@@deriving eq]
let pp fmt _ = Format.pp_print_string fmt "<private key>"
let bytes (Private cs) = cs
let of_bytes cs = Private cs
| |
605a19491677538cbca142b887442ed7d50984f02e4f3bdbe8a6ca57cf7b55d2 | spl/emgm | Read.hs | -----------------------------------------------------------------------------
-- |
Module : Generics . EMGM.Functions . Read
Copyright : ( c ) 2008 , 2009 Universiteit Utrecht
-- License : BSD3
--
Maintainer :
-- Stability : experimental
-- Portability : non-portable
--
-- Summary: Gene... | null | https://raw.githubusercontent.com/spl/emgm/dc16c10137487d7eb97aa851a577be66b46070a2/src/Generics/EMGM/Functions/Read.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3
Stability : experimental
Portability : non-portable
Summary: Generic functions that parse strings to produce values.
The functions in this module involve generically parsing a string and
producing a value. Th... | Module : Generics . EMGM.Functions . Read
Copyright : ( c ) 2008 , 2009 Universiteit Utrecht
Maintainer :
implemented by GHC ) as possible . Refer to documentation in " Text . Read " for
declaration , it relies on ' ConDescr ' for information . It is important that
' ConDescr ' accurately ... |
1640ba5a2ba5b828a1a5f9c37b35a34166d5f28188ace27dd09690d49ae8125b | gstew5/snarkl | SyntaxMonad.hs | # LANGUAGE RebindableSyntax
, DataKinds
, ScopedTypeVariables
, PolyKinds
, GADTs
#
, DataKinds
, ScopedTypeVariables
, PolyKinds
, GADTs
#-}
module SyntaxMonad
( -- | Computation monad
Comp
, CompResult
, r... | null | https://raw.githubusercontent.com/gstew5/snarkl/d6ce72b13e370d2965bb226f28a1135269e7c198/src/SyntaxMonad.hs | haskell | | Computation monad
| Return a fresh input variable.
| Return a fresh variable.
| Return a fresh location.
| Basic values
| Arrays
| Pairs
| Basic static analysis
| Show the current state.
| Misc. functions imported by 'Syntax.hs'
----------------------------------------------
State Monad
-------------------... | # LANGUAGE RebindableSyntax
, DataKinds
, ScopedTypeVariables
, PolyKinds
, GADTs
#
, DataKinds
, ScopedTypeVariables
, PolyKinds
, GADTs
#-}
module SyntaxMonad
Comp
, CompResult
, runState
, return
, (>>=... |
a6d26a95adfd565b6fcbb80eeba3a18e0d955fbb5b5a22fdbc13b708e0dfaf5f | Bluehouse-Technology/grpc | statistics_client.erl | -module(statistics_client).
this file was generated by
-export([get_stats/3]).
-type 'type_parameter.stats_type'() ::
microstate_accounting.
-type 'thread.thread_type'() ::
async |
scheduler |
aux.
-type counter_stat() ::
#{aux => integer(),
check_io => integer(),
emulator => int... | null | https://raw.githubusercontent.com/Bluehouse-Technology/grpc/cdb7ab70c57e248d474369d6b3c5de77151f52f7/test/statistics_client.erl | erlang | messages.
RPCs for service get_stats
This is a unary RPC | -module(statistics_client).
this file was generated by
-export([get_stats/3]).
-type 'type_parameter.stats_type'() ::
microstate_accounting.
-type 'thread.thread_type'() ::
async |
scheduler |
aux.
-type counter_stat() ::
#{aux => integer(),
check_io => integer(),
emulator => int... |
9194e1a243dc42bb1536a30a74ccc69be8343bdf1f6d541884261e947351aa66 | privet-kitty/cl-competitive | tzcount.lisp | (defpackage :cp/tzcount
(:use :cl)
(:export #:tzcount))
(in-package :cp/tzcount)
(declaim (inline tzcount))
(defun tzcount (x)
"Returns the number of trailing zero bits of X. Note that (TZCOUNT 0) = -1."
(- (integer-length (logand x (- x))) 1))
| null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/befae13ad834339730bed144742778f379389ae8/module/tzcount.lisp | lisp | (defpackage :cp/tzcount
(:use :cl)
(:export #:tzcount))
(in-package :cp/tzcount)
(declaim (inline tzcount))
(defun tzcount (x)
"Returns the number of trailing zero bits of X. Note that (TZCOUNT 0) = -1."
(- (integer-length (logand x (- x))) 1))
| |
051004ca091c37600c89945230a4b60ed7fe7d7fec608a4e8afa3aee3cf78f04 | Chris00/ocaml-dropbox | media.ml | open Lwt
module D = Dropbox_lwt_unix
let media t fn =
D.media t fn >>= function
| Some media -> Lwt_io.printlf "%s" (Dropbox_j.string_of_link media)
| None -> Lwt_io.printlf "No file %s" fn
let main t args =
match args with
| [] -> Lwt_io.printlf "No file or folder specified"
| _ -> Lwt_list.iter_p (media... | null | https://raw.githubusercontent.com/Chris00/ocaml-dropbox/36b222269e6bc7e5486cbb69738841d87a1212fb/tests/media.ml | ocaml | open Lwt
module D = Dropbox_lwt_unix
let media t fn =
D.media t fn >>= function
| Some media -> Lwt_io.printlf "%s" (Dropbox_j.string_of_link media)
| None -> Lwt_io.printlf "No file %s" fn
let main t args =
match args with
| [] -> Lwt_io.printlf "No file or folder specified"
| _ -> Lwt_list.iter_p (media... | |
e4a80048f458bbeadc2b6aa98b4ba533f67c02fc6309641a5d657254b99549cc | ocaml/ocamlbuild | resource.mli | (***********************************************************************)
(* *)
(* ocamlbuild *)
(* *)
, , projet Galliu... | null | https://raw.githubusercontent.com/ocaml/ocamlbuild/792b7c8abdbc712c98ed7e69469ed354b87e125b/src/resource.mli | ocaml | *********************************************************************
ocamlbuild
... | , , projet Gallium , INRIA Rocquencourt
Copyright 2007 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
Original author :
open My_std
open Pathname
type... |
34bcaf1b594a200c66b47cbf0536457921f069cadf8020206e814226af4c3963 | lambdaisland/data-printers | transit.cljc | (ns lambdaisland.data-printers.transit
"Create write handlers for Transit
The handlers simply get added to an atom, it's up to you to refer to them
when constructing your transit writer."
(:require [cognitect.transit :as transit]
#?(:clj [clojure.java.io :as io]))
#?(:cljs (:require-macros [lambd... | null | https://raw.githubusercontent.com/lambdaisland/data-printers/586bc6897f15367c19d5973dde58bd8463d043f2/src/lambdaisland/data_printers/transit.cljc | clojure | (ns lambdaisland.data-printers.transit
"Create write handlers for Transit
The handlers simply get added to an atom, it's up to you to refer to them
when constructing your transit writer."
(:require [cognitect.transit :as transit]
#?(:clj [clojure.java.io :as io]))
#?(:cljs (:require-macros [lambd... | |
b4490bdb2a52601924e3bb8c3d8d63d3fa2e0e14ee2ad2687602741aaf9672e7 | jordwalke/rehp | quicksort.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/jordwalke/rehp/f122b94f0a3f06410ddba59e3c9c603b33aadabf/benchmarks/sources/ml/quicksort.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : quicksort.ml 7017 2005 - 08 -... |
0e105531f351d3e918a7e4f699a996520450054fe3e9069c3e492bb603822976 | spell-music/amsterdam | Classic.hs | additional parameters : ifc , imod , ifqm , ifm
This is a ' classical ' amplitude modulation design through which
one can control the precise percentage of amplitude modulation
of a signal . The first section plays notes with an amplitude
modulation increasing from 0 to 1 in steps of 0.2 imod . The
amplitu... | null | https://raw.githubusercontent.com/spell-music/amsterdam/ab491022c7826c74eab557ecd11794268f5a5ae0/33-am/Classic.hs | haskell | additional parameters : ifc , imod , ifqm , ifm
This is a ' classical ' amplitude modulation design through which
one can control the precise percentage of amplitude modulation
of a signal . The first section plays notes with an amplitude
modulation increasing from 0 to 1 in steps of 0.2 imod . The
amplitu... | |
92f2357e11590c9bdb5052985bf47638979106fdcc6969e326099d85c2018ff7 | fission-codes/fission | Error.hs | module Fission.JSON.Error (Error (..)) where
import qualified RIO.Text as Text
import Fission.Prelude hiding (Error)
newtype Error = Error String
deriving newtype (Eq, Show)
deriving anyclass Exception
instance Display Error where
textDisplay (Error str) = "JSON error: " <> Text.pack str
| null | https://raw.githubusercontent.com/fission-codes/fission/11d14b729ccebfd69499a534445fb072ac3433a3/fission-core/library/Fission/JSON/Error.hs | haskell | module Fission.JSON.Error (Error (..)) where
import qualified RIO.Text as Text
import Fission.Prelude hiding (Error)
newtype Error = Error String
deriving newtype (Eq, Show)
deriving anyclass Exception
instance Display Error where
textDisplay (Error str) = "JSON error: " <> Text.pack str
| |
57ab31649fb994e61b43011c4c060cb208a8e95c828f4c6d519c3b9b62c8dd4a | masateruk/micro-caml | factorial.ml | let () =
let rec factorial x =
if x = 0 then 1 else
x * factorial (x - 1) in
print_int (factorial 5)
| null | https://raw.githubusercontent.com/masateruk/micro-caml/0c0bd066b87cf54ce33709355c422993a85a86a1/test/factorial.ml | ocaml | let () =
let rec factorial x =
if x = 0 then 1 else
x * factorial (x - 1) in
print_int (factorial 5)
| |
7431efe9d5d7eeea83fce9abbd7b1899e961c2703f6af7d34c8d1fad7102874d | lab-79/dspec | gen.clj | (ns lab79.dspec.gen
(:require [clojure.spec :as s]
[clojure.spec.gen :as gen]
[clojure.test.check.generators :refer [generator?]]
))
;; Helpers to use in defining generator definitions
(s/fdef fn->gen
:args (s/cat :func (s/fspec :args (s/cat)
... | null | https://raw.githubusercontent.com/lab-79/dspec/26f88e74066e381c8569d175c1bd5948a8005bd0/src/clj/lab79/dspec/gen.clj | clojure | Helpers to use in defining generator definitions
clojure.spec/keys is a macro so it can't take a symbol like `ensure-keys` directly | (ns lab79.dspec.gen
(:require [clojure.spec :as s]
[clojure.spec.gen :as gen]
[clojure.test.check.generators :refer [generator?]]
))
(s/fdef fn->gen
:args (s/cat :func (s/fspec :args (s/cat)
:ret any?))
:ret generator?)
(defn fn... |
88760a76a2886f7545e25e27a605c7e777ff2005538cc432af5f035534a2138f | borodust/aw-skia | utils.lisp | (cl:defpackage :skia
(:use :cl)
(:export))
(cl:in-package :skia)
(defun ignore-uninstantiable ()
(claw.resect:ignore-some
;; these are mostly screwed by being forward declared
(claw.resect:ignore-every
(claw.resect:ignore-names
"sk_sp<.*>"
"GrGLInterface::.*")
(claw.resect:ign... | null | https://raw.githubusercontent.com/borodust/aw-skia/632af8924e2d75809343cec042ecfbce3758dc2a/src/utils.lisp | lisp | these are mostly screwed by being forward declared
this template is unexposed for some reason | (cl:defpackage :skia
(:use :cl)
(:export))
(cl:in-package :skia)
(defun ignore-uninstantiable ()
(claw.resect:ignore-some
(claw.resect:ignore-every
(claw.resect:ignore-names
"sk_sp<.*>"
"GrGLInterface::.*")
(claw.resect:ignore-not
(claw.resect:ignore-names
"sk_sp<S... |
0a0c58e90565e8adf3c08610f92cfd33dd808e713d7a3dcfcffb7c9760097e99 | janestreet/hardcaml_verify | test_cnf.ml | open Base
open Stdio
open Expect_test_helpers_base
open Hardcaml_verify
let a = Cnf.Literal.create "a" ~width:2
let b = Cnf.Literal.create1 "b"
let cnf =
Cnf.(
Conjunction.of_list
[ Disjunction.of_list [ a.(0); a.(1); ~:b ]; Disjunction.of_list [ ~:(a.(1)); b ] ]
|> create)
;;
let%expect_test "empty"... | null | https://raw.githubusercontent.com/janestreet/hardcaml_verify/5d4f1622335caa2ec7db67de2adcddb13aa7c855/test/test_cnf.ml | ocaml | fancy pretty printer | open Base
open Stdio
open Expect_test_helpers_base
open Hardcaml_verify
let a = Cnf.Literal.create "a" ~width:2
let b = Cnf.Literal.create1 "b"
let cnf =
Cnf.(
Conjunction.of_list
[ Disjunction.of_list [ a.(0); a.(1); ~:b ]; Disjunction.of_list [ ~:(a.(1)); b ] ]
|> create)
;;
let%expect_test "empty"... |
f335bf822a855573526149578fe48db2dc3f442e490e0a25676d8e4099240214 | KennethAdamMiller/superset_disassembler | metrics.ml | open Bap.Std
open Core_kernel
open Or_error
module Linear = Disasm_expert.Linear
exception Inconsistent_img of string
type format_as = | Latex
| Standard
[@@deriving sexp]
type metrics = {
name : string;
detected_insn_count : int;
false_negatives : int;
false_positives ... | null | https://raw.githubusercontent.com/KennethAdamMiller/superset_disassembler/54447ba9aa10ab667c744a876a698abbc365bc30/src/metrics.ml | ocaml | open Bap.Std
open Core_kernel
open Or_error
module Linear = Disasm_expert.Linear
exception Inconsistent_img of string
type format_as = | Latex
| Standard
[@@deriving sexp]
type metrics = {
name : string;
detected_insn_count : int;
false_negatives : int;
false_positives ... | |
af968486fc6871c2fdb694b938c856bc70910af8d09bae0ab1a6da5a18f23606 | rowangithub/DOrder | 221_ex23.ml | let rec loop (y:int) z c =
if (c < 36) then
(assert (0 <= z && z < 4608);
loop y (z+1) (c+1))
else ()
let main y =
let c = 0 in
if (y >= 0 && y <= 127) then
let z = y * 36 in
loop y z c
else () | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/mochi2/benchs/221_ex23.ml | ocaml | let rec loop (y:int) z c =
if (c < 36) then
(assert (0 <= z && z < 4608);
loop y (z+1) (c+1))
else ()
let main y =
let c = 0 in
if (y >= 0 && y <= 127) then
let z = y * 36 in
loop y z c
else () | |
8c92492cfd12d0847f72c1f4ae441d8f54a956617c86fb6d77199ca3e95a34c1 | jaseemabid/mit-scheme | run.scm | (define (time-command thunk-maker)
(define (say . stuff) (for-each display stuff))
(let ((n 5))
(let loop ((i n) (times '()) (value '?))
(if (> i 0)
(let ((thunk (thunk-maker)))
(let ((start (runtime))) ; process time - gc process time
(let ((value (thunk)))
(let ((end (runtime)))
(l... | null | https://raw.githubusercontent.com/jaseemabid/mit-scheme/d30da6b2c103e34b6e0805bd5cbefeb9501382c1/v8/src/bench/run.scm | scheme | process time - gc process time
"earley"
"flatten" | (define (time-command thunk-maker)
(define (say . stuff) (for-each display stuff))
(let ((n 5))
(let loop ((i n) (times '()) (value '?))
(if (> i 0)
(let ((thunk (thunk-maker)))
(let ((value (thunk)))
(let ((end (runtime)))
(loop (- i 1) (cons (- end start) times) value)))))
(fluid-let ... |
5361316d08eea5bd68f60ad99d91636456a3b299cf753d56c45be988af0aa8b0 | gsakkas/rite | 0010.ml | LamG VarPatG VarG
fun b -> b
fun x -> x
fun q -> q
fun y -> y
fun a -> a
fun p -> p
fun z -> z
| null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/data/sp14_min/clusters/0010.ml | ocaml | LamG VarPatG VarG
fun b -> b
fun x -> x
fun q -> q
fun y -> y
fun a -> a
fun p -> p
fun z -> z
| |
caeb3d3e215e88d9568aaa5579eb03078d59b7b48f5b76de19405503f4a30174 | samirose/sicp-compiler-project | or.scm | (import (compiler-test)
(or))
(compiler-test-begin "or")
(compiler-test-eq
"empty or is false"
#f (empty-or-is-false))
(compiler-test-eq
"or one false is false"
#f (or-one-false-is-false))
(compiler-test-eq
"or with one non-false value is the value"
42 (or-one-non-false-value-is-value))
(compiler-test-eq
"... | null | https://raw.githubusercontent.com/samirose/sicp-compiler-project/2bc8a481044b5a653408f8595b2a2396600b8ad6/test-compiler/test/or.scm | scheme | (import (compiler-test)
(or))
(compiler-test-begin "or")
(compiler-test-eq
"empty or is false"
#f (empty-or-is-false))
(compiler-test-eq
"or one false is false"
#f (or-one-false-is-false))
(compiler-test-eq
"or with one non-false value is the value"
42 (or-one-non-false-value-is-value))
(compiler-test-eq
"... | |
b8bc8e4d0b0ea85c246eb6eaf2de214b7456e54fc4ac3ff8f05b5e830d0dc018 | binaryage/chromex | power.clj | (ns chromex.ext.power
"Use the chrome.power API to override the system's power
management features.
* available since Chrome 36
* "
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-cal... | null | https://raw.githubusercontent.com/binaryage/chromex/33834ba5dd4f4238a3c51f99caa0416f30c308c5/src/exts/chromex/ext/power.clj | clojure | -- convenience ------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
-- API TABLE --------------------------------------------------------... | (ns chromex.ext.power
"Use the chrome.power API to override the system's power
management features.
* available since Chrome 36
* "
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-cal... |
e4797ec5d91e19e4d3c471620d2e6418be3a6753366763e68114214331084ecc | input-output-hk/plutus-apps | EscrowImpl.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
{-# LANGUAGE NamedFieldPuns #-}
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings ... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/006f4ae4461094d3e9405a445b0c9cf48727fa81/doc/plutus/tutorials/EscrowImpl.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
END OPTIONS_GHC
$escrow
* Actions
* Exposed for test endpoints
* Coverage
END imports
$escrow
The escrow c... | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE TypeApplications #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fplugin - opt PlutusTx . P... |
4be5fa3952e5d346548b464663dd34bd10cdfa78ccbb23764e6e7ed7aa24a23c | jabber-at/ejabberd | ejabberd_access_permissions.erl | %%%-------------------------------------------------------------------
%%% File : ejabberd_access_permissions.erl
Author : < >
%%% Purpose : Administrative functions and commands
Created : 7 Sep 2016 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2018 ProcessOne
%%%
%%% This program is free soft... | null | https://raw.githubusercontent.com/jabber-at/ejabberd/7bfec36856eaa4df21b26e879d3ba90285bad1aa/src/ejabberd_access_permissions.erl | erlang | -------------------------------------------------------------------
File : ejabberd_access_permissions.erl
Purpose : Administrative functions and commands
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope tha... | Author : < >
Created : 7 Sep 2016 by < >
ejabberd , Copyright ( C ) 2002 - 2018 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
... |
a0c477ae98104052f8c14ac773fcfa25581e0167b5c7076272775482389c6898 | stchang/mlish | reader.rkt | #lang s-exp syntax/module-reader
mlish/mlish+adhoc
| null | https://raw.githubusercontent.com/stchang/mlish/1c79d71b686fc734b7994eb9d412f84d518a64b1/mlish-lib/mlish%2Badhoc/lang/reader.rkt | racket | #lang s-exp syntax/module-reader
mlish/mlish+adhoc
| |
78270eeb0509344101ed993d36d642457cc3a2621486b940e85b0dc42c5e2d26 | tarides/ocaml-jit | simple_fun.ml | let [@inline never] f x = x +. 2.0 in f 1.0;;
| null | https://raw.githubusercontent.com/tarides/ocaml-jit/fe2fce1a5bb89acf5f7239917f6098d53c2c14ec/tests/simple_fun.ml | ocaml | let [@inline never] f x = x +. 2.0 in f 1.0;;
| |
657a4ed7642be02232c58bba332dea776526d17812839a1fc544e739d3974faa | tokiwoousaka/takahashi | API.hs | {-# LANGUAGE RankNTypes #-}
module Control.Monad.Takahashi.API
( Contents(..)
, bindPage
----
, takaCont
, listCont
, parCont
, takaCont2
, listCont2
, parCont2
, imgCont
, codeCont
, horizonCont
, verticalCont
, annotationCont
, twinTopCont
, twinBottomCont
, twinLeftCon... | null | https://raw.githubusercontent.com/tokiwoousaka/takahashi/7c7bd5fcb1fad26c83f225199a29138f6f3cde94/src/Control/Monad/Takahashi/API.hs | haskell | # LANGUAGE RankNTypes #
--
--
--
--
Contents
--
--
--
slides
----
helper
--
--
-- | module Control.Monad.Takahashi.API
( Contents(..)
, bindPage
, takaCont
, listCont
, parCont
, takaCont2
, listCont2
, parCont2
, imgCont
, codeCont
, horizonCont
, verticalCont
, annotationCont
, twinTopCont
, twinBottomCont
, twinLeftCont
, twinRightCont
, titleCont... |
4303ce66102a718bdd12cc2d33a44ae29f7fe58e740eaf4df3fe159b2b1ef4e6 | mfikes/fifth-postulate | ns16.cljs | (ns fifth-postulate.ns16)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (xs... | null | https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns16.cljs | clojure | (ns fifth-postulate.ns16)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (xs... | |
d2f48af07072064634643d979e482a8eeb419648b0cdd35bf74b973759535f6b | clojure-interop/aws-api | AmazonRoute53DomainsAsync.clj | (ns com.amazonaws.services.route53domains.AmazonRoute53DomainsAsync
"Interface for accessing Amazon Route 53 Domains asynchronously. Each asynchronous method will return a Java Future
overloads which accept an AsyncHandler can be used to receive
notification when an asynchronous operation completes.
Note: Do n... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.route53domains/src/com/amazonaws/services/route53domains/AmazonRoute53DomainsAsync.clj | clojure | subsequent operations might not immediately represent all issued
subsequent operations might not immediately represent all issued
subsequent operations might not immediately represent all issued | (ns com.amazonaws.services.route53domains.AmazonRoute53DomainsAsync
"Interface for accessing Amazon Route 53 Domains asynchronously. Each asynchronous method will return a Java Future
overloads which accept an AsyncHandler can be used to receive
notification when an asynchronous operation completes.
Note: Do n... |
90d814dc1b788c6d0480db7a621c58275c5665b89749516fd243e5776316b39b | iskandr/parakeet-retired | GcState.mli |
open Base
type t
val create : unit -> t
val pin : t -> Ptr.t -> unit
val unpin : t -> Ptr.t -> unit
val add_used_ptr : t -> Ptr.t -> unit
(* any ptrs which fail predicate get moved to free map *)
val filter_used_ptrs : t -> (Ptr.t -> bool) -> unit
val add_free_ptr : t -> Ptr.t -> unit
val find_free_ptr : t -> i... | null | https://raw.githubusercontent.com/iskandr/parakeet-retired/3d7e6e5b699f83ce8a1c01290beed0b78c0d0945/Runtime/Memory/GcState.mli | ocaml | any ptrs which fail predicate get moved to free map |
open Base
type t
val create : unit -> t
val pin : t -> Ptr.t -> unit
val unpin : t -> Ptr.t -> unit
val add_used_ptr : t -> Ptr.t -> unit
val filter_used_ptrs : t -> (Ptr.t -> bool) -> unit
val add_free_ptr : t -> Ptr.t -> unit
val find_free_ptr : t -> int -> Ptr.t option
val iter_free_ptrs : t -> (Ptr.t -> uni... |
1c4a9d0988589682c35c14e77327ca7038e878728a09a959257303af8fd03fa3 | exoscale/clojure-kubernetes-client | v1_daemon_set_condition.clj | (ns clojure-kubernetes-client.specs.v1-daemon-set-condition
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
)
(:import (java.io File)))
(declare v1-daemon-set-condition-data v1-daemon-set-condition)
(def v1-daemon-set-condition-data
{
(ds/opt :lastTransitionTime) in... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1_daemon_set_condition.clj | clojure | (ns clojure-kubernetes-client.specs.v1-daemon-set-condition
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
)
(:import (java.io File)))
(declare v1-daemon-set-condition-data v1-daemon-set-condition)
(def v1-daemon-set-condition-data
{
(ds/opt :lastTransitionTime) in... | |
d055981c663cbbc635a1fa35de4aaf4d8ab00083ad01ba5e658d4ca9dfc495d6 | nd/bird | 5.3.1.hs | --Prove that repeated c `div` base leads to value -1 <= c < base
repeated div:
rdiv x base = if x < base then x
else rdiv (x `div` base) base
by induction on c:
for any -1 <= c < base
rdiv c base = c, by definition of rdiv
suppose statement is right for some c',
then for any c = c' * base
rdiv c base =... | null | https://raw.githubusercontent.com/nd/bird/06dba97af7cfb11f558eaeb31a75bd04cacf7201/ch05/5.3.1.hs | haskell | Prove that repeated c `div` base leads to value -1 <= c < base |
repeated div:
rdiv x base = if x < base then x
else rdiv (x `div` base) base
by induction on c:
for any -1 <= c < base
rdiv c base = c, by definition of rdiv
suppose statement is right for some c',
then for any c = c' * base
rdiv c base =
{def of rdiv}
rdiv (c `div` base) base =
{c <= c' * base}
rdiv ... |
dbf30f420de0fa40b2af49472a4cdac55e224705620b4c7d759a634c4a22ae13 | jebberjeb/reframe-fsm | server.clj | (ns reframe-fsm.server
(:require
[clojure.string :as string]
[io.pedestal.http :as http]))
(defn login
[request]
(let [{:keys [email password]}
(:query-params request)]
#_{:status 200 :body "success"}
#_{:status 400 :body "invalid password"}
{:status 400 :body "user not found"}))
(de... | null | https://raw.githubusercontent.com/jebberjeb/reframe-fsm/a88be427d33b0b3adeb1d359c2c6ce5cad2be825/login-fsm/src/clj/reframe_fsm/server.clj | clojure | Don't block the REPL. | (ns reframe-fsm.server
(:require
[clojure.string :as string]
[io.pedestal.http :as http]))
(defn login
[request]
(let [{:keys [email password]}
(:query-params request)]
#_{:status 200 :body "success"}
#_{:status 400 :body "invalid password"}
{:status 400 :body "user not found"}))
(de... |
d1067aed2786831a30a0cf52676e6dafc831489577b28d2f2b5cbe600338f304 | relaynetwork/pdfbox | core.clj | (ns pdfbox.test.core
(:use [pdfbox.core] :reload)
(:use [clojure.test]))
(deftest replace-me ;; FIXME: write
(is false "No tests have been written."))
| null | https://raw.githubusercontent.com/relaynetwork/pdfbox/be074145831009284d7fa70b0aeda7f754c68de3/test/pdfbox/test/core.clj | clojure | FIXME: write | (ns pdfbox.test.core
(:use [pdfbox.core] :reload)
(:use [clojure.test]))
(is false "No tests have been written."))
|
69d7ab7fa77321ccadaef66af07c65bce33c2b16954f1e2ec3883a6e0a56dc5b | S8A/htdp-exercises | ex135.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex135) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex135.rkt | racket | about the language level of this file in a form that our tools can easily process.
– '()
– (cons String List-of-names)
interpretation a list of invitees, by last name
List-of-names -> Boolean
determines whether "Flatt" is on a-list-of-names | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex135) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t ... |
d467dda8ab9a24c455b1cd5246694c019520e7821a3bf317ae0eaa847f629556 | effectai/effect-network | set_highguard.cljs | (ns set-highguard
(:require
[eos-cljs.core :as eos]
[cljs.core :refer [*command-line-args*]]
[clojure.string :as string]
[clojure.pprint :refer [pprint]]
[cljs.core.async.interop :refer [<p!]]
[cljs.core.async :refer [go] :as async]
[eos-cljs.node-api :as eos-node :refer [deploy-file]]
[eos-c... | null | https://raw.githubusercontent.com/effectai/effect-network/f244bfa8f2ba598c23c5c0885ae148514fd4785d/deploy/set_highguard.cljs | clojure | (ns set-highguard
(:require
[eos-cljs.core :as eos]
[cljs.core :refer [*command-line-args*]]
[clojure.string :as string]
[clojure.pprint :refer [pprint]]
[cljs.core.async.interop :refer [<p!]]
[cljs.core.async :refer [go] :as async]
[eos-cljs.node-api :as eos-node :refer [deploy-file]]
[eos-c... | |
a55f28b953d637ca30e962e85adc47c20bc23107333425acff3fda0751d43216 | jmid/regexpanalyser | last.ml | module A = Ast
type stmt = { label : int;
stmt : stmt_desc; }
and stmt_desc =
| Skip
| Assign of A.var * A.aexp
| Seq of stmt * stmt
| While of A.bexp * stmt
| If of A.bexp * stmt * stmt
| Chread of A.chan * A.var
| Chwrite of A.chan * A.aexp
| Choice of stmt * stmt
| Stop
let reset,make_lab... | null | https://raw.githubusercontent.com/jmid/regexpanalyser/317c2153e593a3abf8887d15b48380672a8021a1/src/last.ml | ocaml | * Smart constructors for creating labelled statements | module A = Ast
type stmt = { label : int;
stmt : stmt_desc; }
and stmt_desc =
| Skip
| Assign of A.var * A.aexp
| Seq of stmt * stmt
| While of A.bexp * stmt
| If of A.bexp * stmt * stmt
| Chread of A.chan * A.var
| Chwrite of A.chan * A.aexp
| Choice of stmt * stmt
| Stop
let reset,make_lab... |
a63a5b8d5b957a580d74b88fd910014e7b561577036bb203fc33a9beed5605dd | maxdore/elfe | Elfe.hs | module Elfe
( module Elfe.Language
, module Elfe.Preprocessor
, module Elfe.Parser
, module Elfe.Verifier
) where
import Elfe.Language
import Elfe.Preprocessor
import Elfe.Parser
import Elfe.Verifier | null | https://raw.githubusercontent.com/maxdore/elfe/56ecf5f704594221f30e342b9bb9dbc7874f5656/src/Elfe.hs | haskell | module Elfe
( module Elfe.Language
, module Elfe.Preprocessor
, module Elfe.Parser
, module Elfe.Verifier
) where
import Elfe.Language
import Elfe.Preprocessor
import Elfe.Parser
import Elfe.Verifier | |
6461807d9fb1eadce0d94b25320b8676c7425fb72587edb49d3c168c6372a253 | jfeser/castor | constructors.ml | open Core
module V = Visitors
module Query = struct
open Ast
let select a b = select (Select_list.of_list_exn a, b)
let select_ns a b =
select (Select_list.of_names @@ List.map ~f:Name.of_string_exn a) b
let range a b = range (a, b)
let dep_join' = depjoin
let dep_join a c = dep_join' { d_lhs = a; d... | null | https://raw.githubusercontent.com/jfeser/castor/e9f394e9c0984300f71dc77b5a457ae4e4faa226/lib/constructors.ml | ocaml | (\** Construct annotated queries. Existing metadata is cast into the new metadata type. *\)
module Annot_default (C : sig
type _ m
type m'
val default : m'
end) =
struct
type 'a m = 'a C.m
type m' = C.m'
type 'a annot = 'a m Ast.annot
type 'a pred = 'a m Ast.annot Ast.pred
type 'a... | open Core
module V = Visitors
module Query = struct
open Ast
let select a b = select (Select_list.of_list_exn a, b)
let select_ns a b =
select (Select_list.of_names @@ List.map ~f:Name.of_string_exn a) b
let range a b = range (a, b)
let dep_join' = depjoin
let dep_join a c = dep_join' { d_lhs = a; d... |
2798b84505f519cb11446ab281f59e8c3eddadedfd2a2355860ec24e2dbc07de | 8thlight/hyperion | big_number.clj | (ns hyperion.riak.map-reduce.big-number)
(def big-number-js
"
var BigNumber = (function () {
var P = Big.prototype,
isValid = /^-?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?$/i;
function Big( n ) {
var i, j, nL,
x = this;
if ( !(x instanceof Big) ) {
return new Big( n )
... | null | https://raw.githubusercontent.com/8thlight/hyperion/b1b8f60a5ef013da854e98319220b97920727865/riak/src/hyperion/riak/map_reduce/big_number.clj | clojure |
) {
n.charAt(--nL) == '0'; ) {
x['c'][i++ ] = + n.charAt(j++ ) ) {
) {
| (ns hyperion.riak.map-reduce.big-number)
(def big-number-js
"
var BigNumber = (function () {
var P = Big.prototype,
function Big( n ) {
var i, j, nL,
if ( !(x instanceof Big) ) {
return new Big( n )
}
if ( n instanceof Big ) {
return
}
... |
ca103e8522914ab86882a38d0a169ae9804fd4db5e0ff9478a2bb1767b81b3f0 | sunlightlabs/echelon | schema.clj | (ns echelon.schema
(:require [datomic.api :refer [tempid]]))
;; Lobbying codes taken from
(def issue-codes
{"ACC" "Accounting"
"ADV" "Advertising"
"AER" "Aerospace"
"AGR" "Agriculture"
"ALC" "Alcohol & Drug Abuse"
"ANI" "Animals"
"APP" "Apparel/Clothing Industry/Textiles"
"ART" "Arts/Entertai... | null | https://raw.githubusercontent.com/sunlightlabs/echelon/c3645fd6fa8447772d667e8ba2a8fe47e2b7c7bf/src/echelon/schema.clj | clojure | Lobbying codes taken from
Helper functions for datomic. We're not doing too many fancy things
here with datomic and the main struggle has just been understanding
the layout of the data, so we've abstracted away the creation of the
Various grouping of attributes from the schema
Both types
Activities from registrations... | (ns echelon.schema
(:require [datomic.api :refer [tempid]]))
(def issue-codes
{"ACC" "Accounting"
"ADV" "Advertising"
"AER" "Aerospace"
"AGR" "Agriculture"
"ALC" "Alcohol & Drug Abuse"
"ANI" "Animals"
"APP" "Apparel/Clothing Industry/Textiles"
"ART" "Arts/Entertainment"
"AUT" "Automotive In... |
9de4ae8f8cece795c13da4919b21cd5b8a9f8aa1c20c52bc319cc363987d1f90 | soenkehahn/looper | FFI.hs | module Looper.CBindings.FFI where
import Foreign.C.Types
import Foreign.Ptr
import Looper.CBindings
foreign import ccall "create_looper" c_create_looper ::
IO (Ptr CLooper)
foreign import ccall "set_buffer" c_set_buffer ::
Ptr CLooper -> Ptr CFloat -> Int -> IO ()
cBindings :: CBinding... | null | https://raw.githubusercontent.com/soenkehahn/looper/c99792a485307643c36509dd71b752fce11033ab/src/Looper/CBindings/FFI.hs | haskell | module Looper.CBindings.FFI where
import Foreign.C.Types
import Foreign.Ptr
import Looper.CBindings
foreign import ccall "create_looper" c_create_looper ::
IO (Ptr CLooper)
foreign import ccall "set_buffer" c_set_buffer ::
Ptr CLooper -> Ptr CFloat -> Int -> IO ()
cBindings :: CBinding... | |
63d9bda3075fd0d800721bcaeff238102f7bc68a13c5bec2fa0bd13214cb1354 | AndrasKovacs/ELTE-func-lang | Feladatok.hs | # LANGUAGE DeriveFunctor #
{-# OPTIONS_GHC -Wincomplete-patterns #-}
import Control.Applicative
import Control.Monad
import Data.Char
State monad
--------------------------------------------------------------------------------
newtype State s a = State {runState :: s -> (a, s)}
deriving Functor
instance Applica... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2019-20-2/vizsga_minta/minta3/Feladatok.hs | haskell | # OPTIONS_GHC -Wincomplete-patterns #
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Feladatok
------------------------------------------------------------------------------
-----... | # LANGUAGE DeriveFunctor #
import Control.Applicative
import Control.Monad
import Data.Char
State monad
newtype State s a = State {runState :: s -> (a, s)}
deriving Functor
instance Applicative (State s) where
pure = return
(<*>) = ap
instance Monad (State s) where
return a = State $ \s -> (a, s)
Stat... |
bbca2e2f2e5246edb408898ea5ec508889c0508d01389c62106b86cfd2511b13 | janestreet/universe | string_dict.ml | open Base
open Ppx_compare_lib.Builtin
In order to be efficient , we make assumption about the runtime representation of
strings . Essentially we assume that it 's OK to see a string as a flat array of words
and that padding bytes are never random .
Since this is probably not portable in Javascript ,... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/string_dict/src/string_dict.ml | ocaml | A block. This module only assume that we can split a string into a list of blocks.
(compact) array of blocks
These functions are used to compile a association list into a trie
A dictionary is organized as a trie. This type is accessed by the C implementation of
[find].
Block array of length [num_children] ... | open Base
open Ppx_compare_lib.Builtin
In order to be efficient , we make assumption about the runtime representation of
strings . Essentially we assume that it 's OK to see a string as a flat array of words
and that padding bytes are never random .
Since this is probably not portable in Javascript ,... |
71aa618440ee27c713904447e5de9a9e28bc96a2fff21dcb7be29083d02b143c | janestreet/core_kernel | vec_intf.ml | open! Core
module type S = sig
type index
type 'a t [@@deriving compare, equal, sexp]
include Invariant.S1 with type 'a t := 'a t
val create : ?initial_capacity:int -> unit -> 'a t
(** [init n ~f] returns a fresh vector of length [n], with element number [i]
initialized to the result of [f i]. In ot... | null | https://raw.githubusercontent.com/janestreet/core_kernel/597299d11c2ee99f219592d89a5890f8f0b6dfe7/vec/src/vec_intf.ml | ocaml | * [init n ~f] returns a fresh vector of length [n], with element number [i]
initialized to the result of [f i]. In other words, [init n ~f] tabulates the
results of [f] applied to the integers [0] to [n-1].
Raise Invalid_argument if [n < 0].
* Raises if the index is invalid.
* Raises if the index... | open! Core
module type S = sig
type index
type 'a t [@@deriving compare, equal, sexp]
include Invariant.S1 with type 'a t := 'a t
val create : ?initial_capacity:int -> unit -> 'a t
val init : int -> f:((int -> 'a)[@local]) -> 'a t
val get : 'a t -> index -> 'a
val maybe_get : 'a t -> index -> 'a opt... |
2e8a0b77887ae87bb7f5c0ffc62ca70a183d8304f8688c2fd0752761f0a4d49a | dharmatech/surfage | op-ctor.scm | (begin
(define array:opt-args '(ctor (4)))
(define (array:optimize f r)
(case r
((0) (let ((n0 (f))) (array:0 n0)))
((1) (let ((n0 (f 0))) (array:1 n0 (- (f 1) n0))))
((2)
(let ((n0 (f 0 0)))
(array:2 n0 (- (f 1 0) n0) (- (f 0 1) n0))))
((3)
(let ((n0 (f 0 0 0)))
... | null | https://raw.githubusercontent.com/dharmatech/surfage/895f16af83d9ce3c190f69626c9baba8c44d76bc/s25/op-ctor.scm | scheme | (begin
(define array:opt-args '(ctor (4)))
(define (array:optimize f r)
(case r
((0) (let ((n0 (f))) (array:0 n0)))
((1) (let ((n0 (f 0))) (array:1 n0 (- (f 1) n0))))
((2)
(let ((n0 (f 0 0)))
(array:2 n0 (- (f 1 0) n0) (- (f 0 1) n0))))
((3)
(let ((n0 (f 0 0 0)))
... | |
8401b6a7d58c93009e39aaf4d1f0b3c0d15efc20edce70dbe79eeb86ca870a85 | crategus/cl-cffi-gtk | rtest-gtk-text-view.lisp | (def-suite gtk-text-view :in gtk-suite)
(in-suite gtk-text-view)
;;; --- Types and Values -------------------------------------------------------
GtkTextViewLayer
;;; GtkTextWindowType
GtkTextExtendSelection
;;; GtkWrapMode ---> gtk.text-attributes.lisp
;;; GtkTex... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/7f5a09f78d8004a71efa82794265f2587fff98ab/test/rtest-gtk-text-view.lisp | lisp | --- Types and Values -------------------------------------------------------
GtkTextWindowType
GtkWrapMode ---> gtk.text-attributes.lisp
GtkTextChildAnchor
GtkTextView
--- Properties -------------------------------------------------------------
--- Style Properties -... | (def-suite gtk-text-view :in gtk-suite)
(in-suite gtk-text-view)
GtkTextViewLayer
GtkTextExtendSelection
(test gtk-text-view-properties
(let ((view (make-instance 'gtk-text-view)))
(is-true (gtk-text-view-accepts-tab view))
(is (= 0 (gtk-text-view-bottom-margin view)))
(is (typep (gtk-te... |
0c3e52e62d6a96012cbafc9a06150b57e8970df835676f8b683569923986c6f3 | wardle/hades | core.clj | (ns com.eldrix.hades.core
"Implementation of a FHIR terminology server.
See -service.html"
(:gen-class)
(:require [clojure.tools.logging.readable :as log]
[com.eldrix.hades.convert :as convert]
[com.eldrix.hermes.core :as hermes])
(:import (ca.uhn.fhir.context FhirContext)
(... | null | https://raw.githubusercontent.com/wardle/hades/01bb05abb2ef25c80b5f925f79d7e4f38a24df3d/src/com/eldrix/hades/core.clj | clojure |
components = ValueSetExpansionContainsComponent
| (ns com.eldrix.hades.core
"Implementation of a FHIR terminology server.
See -service.html"
(:gen-class)
(:require [clojure.tools.logging.readable :as log]
[com.eldrix.hades.convert :as convert]
[com.eldrix.hermes.core :as hermes])
(:import (ca.uhn.fhir.context FhirContext)
(... |
f5e8b0ac83bd29178bc09744dfbf76cbde06f28f1b9c691ed87175ff0eb48dff | opencog/learn | entropy-marginals.scm | ;
; Entropy-marginals.scm
;
; Assorted ad-hoc scripts for exploring marginal entropy distributions
; for word-disjunct pairs. These are used to create the graphs and
analysis in " Diary Part Five " ( Jan 2022 ) .
;
; These can ONLY be used by hand, by cutting and pasting the interesting
; bits from this file, into a... | null | https://raw.githubusercontent.com/opencog/learn/e7515219373138e04b8d62282e22fdf5c7cfaa68/learn-lang-diary/utils/entropy-marginals.scm | scheme |
Entropy-marginals.scm
Assorted ad-hoc scripts for exploring marginal entropy distributions
for word-disjunct pairs. These are used to create the graphs and
These can ONLY be used by hand, by cutting and pasting the interesting
bits from this file, into a guile prompt. This is effectively a kind-of
work-log of... | analysis in " Diary Part Five " ( Jan 2022 ) .
Copyright ( c ) 2017 Linas Vepstas
( define cset - obj ( make - pseudo - cset - api ) )
(define covr-obj (add-covering-sections cset-obj))
(covr-obj 'fetch-pairs)
(covr-obj 'explode-sections)
(define star-obj covr-obj)
(batch-all-pair-mi star-obj)
Assign each wor... |
e7a5b36693409ea007b6d51fdc4af0d987bd543e37fec75ba2a6a76b9a349e5a | Zulu-Inuoe/clution | package.lisp | ;;;enumerable-tests - tests for the enumerable library
Written in 2018 by < >
;;;
;;;To the extent possible under law, the author(s) have dedicated all copyright
;;;and related and neighboring rights to this software to the public domain
;;;worldwide. This software is distributed without any warranty.
You s... | null | https://raw.githubusercontent.com/Zulu-Inuoe/clution/b72f7afe5f770ff68a066184a389c23551863f7f/cl-clution/qlfile-libs/enumerable-master/t/package.lisp | lisp | enumerable-tests - tests for the enumerable library
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
with this software. If not, see
</>.
Test suite... | Written in 2018 by < >
You should have received a copy of the CC0 Public Domain Dedication along
(defpackage #:enumerable-tests
(:use #:alexandria #:cl #:enumerable)
(:export
#:enumerable
#:expressions
#:expressions.list
#:expressions.vector))
|
820e9792e55cfc94081c48ec2bf087608ba1089ef3745cce71b3e093ff1c7a41 | bcbio/bcbio.variation.recall | intersect.clj | (ns bcbio.variation.ensemble.intersect
"Intersection based Ensemble calling approaches using inputs from multiple callers."
(:import [htsjdk.variant.vcf VCFInfoHeaderLine VCFHeaderLineType VCFHeaderLineCount])
(:require [bcbio.run.fsp :as fsp]
[bcbio.run.itx :as itx]
[bcbio.run.clhelp :as... | null | https://raw.githubusercontent.com/bcbio/bcbio.variation.recall/b7aa436dcb558535f87d004ba0abc5d7bc380b70/src/bcbio/variation/ensemble/intersect.clj | clojure | (fsp/remove-path work-dir) | (ns bcbio.variation.ensemble.intersect
"Intersection based Ensemble calling approaches using inputs from multiple callers."
(:import [htsjdk.variant.vcf VCFInfoHeaderLine VCFHeaderLineType VCFHeaderLineCount])
(:require [bcbio.run.fsp :as fsp]
[bcbio.run.itx :as itx]
[bcbio.run.clhelp :as... |
b640a8e2de329374d84dc8c553132e704bc59e13a2ee8373e4353a3b142c47c5 | rescript-lang/rescript-compiler | ast_utf8_string.mli | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/frontend/ast_utf8_string.mli | ocaml | offset
val transform_test : string -> segments
end | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later... |
3b151e971240eafd3f663af22ba94aad56677e5afdc99bf94625364bf224bd3d | thelema/ocaml-community | selection_own_set.mli | ##ifdef CAMLTK
val own_set : icccm list -> widget -> unit
(** tk invocation: selection own <icccm list> <widget> *)
##else
val own_set :
?command:(unit->unit) -> ?selection:string -> 'a widget -> unit
(** tk invocation: selection own <icccm list> <widget> *)
##endif
| null | https://raw.githubusercontent.com/thelema/ocaml-community/ed0a2424bbf13d1b33292725e089f0d7ba94b540/otherlibs/labltk/builtin/selection_own_set.mli | ocaml | * tk invocation: selection own <icccm list> <widget>
* tk invocation: selection own <icccm list> <widget> | ##ifdef CAMLTK
val own_set : icccm list -> widget -> unit
##else
val own_set :
?command:(unit->unit) -> ?selection:string -> 'a widget -> unit
##endif
|
a1aa79944e3eb48145a1a80d3ea8b64aff093a4f62197f7f3724b2ded281887b | PrincetonUniversity/lucid | FunctionInliningSpecialCase.ml | An inlining pass for certain kinds of functions /
calls that are easy to inline with zero overhead .
To be inlined with no overhead , there are two requirements :
1 . the function never writes to its parameters
2 . the function call appears in an assignment statement ,
OR the function h... | null | https://raw.githubusercontent.com/PrincetonUniversity/lucid/d92c18e69983b246e86afacaaa1bf709d13f5a4e/src/lib/frontend/transformations/FunctionInliningSpecialCase.ml | ocaml | get data about functions in declarations
Check if a variable is never assigned in s.
Check if no parameters are assigned to in a function
replace each parameter with its argument. This should only be caled
for functions with read_only_params!
create map from id (param) to expression (arg)
do all the subs... | An inlining pass for certain kinds of functions /
calls that are easy to inline with zero overhead .
To be inlined with no overhead , there are two requirements :
1 . the function never writes to its parameters
2 . the function call appears in an assignment statement ,
OR the function h... |
baff380c2b921c051225cf6ba8b10a040a97b5297757e847a57e597151290564 | nomasystems/nqueue | nqueue_properties.erl | Copyright 2022 Nomasystems , S.L.
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distri... | null | https://raw.githubusercontent.com/nomasystems/nqueue/54de961fba296592cc39bbe1de8603b1c3d4e168/test/property_test/nqueue_properties.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2022 Nomasystems , S.L.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(nqueue_properties).
-include_lib("triq/include/triq.hrl").
-include_lib("../nqueue_test.hrl").
-compile([export_all, nowarn_export... |
cf3e9bbd9b0889c80cb8c902b052bdea9691e31262077cd0ac487c2c46e23f64 | andrejv/cl-simple-tk | geometry.lisp | ;;;
Copyright ( c ) 2015 < >
;;;
;;; Permission is hereby granted, free of charge, to any person obtaining a copy
;;; of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , including without limitation the rights
;;; to use, copy, modify, merge, publis... | null | https://raw.githubusercontent.com/andrejv/cl-simple-tk/0ef565fedde588caa62148c2551be1520a955567/src/geometry.lisp | lisp |
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice... | Copyright ( c ) 2015 < >
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
... |
d6da3a2364a2b4f57df193f7f9c3398fea4f19298827b98edc551483163694c7 | nomeata/haskell-via-sokoban | 03-start-screen.hs | {-# LANGUAGE OverloadedStrings #-}
import CodeWorld
wall, ground, storage, box :: Picture
wall = colored grey (solidRectangle 1 1)
ground = colored yellow (solidRectangle 1 1)
storage = colored white (solidCircle 0.3) & ground
box = colored brown (solidRectangle 1 1)
data Tile = Wall | Ground | Storage | B... | null | https://raw.githubusercontent.com/nomeata/haskell-via-sokoban/0ae9d6e120c2851eca158c01e08e2c4c7f2b06d0/code/03-start-screen.hs | haskell | # LANGUAGE OverloadedStrings #
Cunning! | import CodeWorld
wall, ground, storage, box :: Picture
wall = colored grey (solidRectangle 1 1)
ground = colored yellow (solidRectangle 1 1)
storage = colored white (solidCircle 0.3) & ground
box = colored brown (solidRectangle 1 1)
data Tile = Wall | Ground | Storage | Box | Blank
drawTile :: Tile -> Pic... |
f053a6ce3af6f0b441bab994e93deafd4df7aaf11478621638180093a4eb45e8 | shayan-najd/NativeMetaprogramming | T10195.hs | {-# OPTIONS_GHC -Wno-redundant-constraints -Wno-simplifiable-class-constraints #-}
# LANGUAGE MultiParamTypeClasses , TypeFamilies , GADTs ,
, DataKinds , KindSignatures ,
FlexibleInstances #
ConstraintKinds, DataKinds, KindSignatures,
FlexibleInstances #-}
modu... | null | https://raw.githubusercontent.com/shayan-najd/NativeMetaprogramming/24e5f85990642d3f0b0044be4327b8f52fce2ba3/testsuite/tests/typecheck/should_compile/T10195.hs | haskell | # OPTIONS_GHC -Wno-redundant-constraints -Wno-simplifiable-class-constraints # | # LANGUAGE MultiParamTypeClasses , TypeFamilies , GADTs ,
, DataKinds , KindSignatures ,
FlexibleInstances #
ConstraintKinds, DataKinds, KindSignatures,
FlexibleInstances #-}
module T10195 where
import GHC.Exts
data Foo m zp r'q = Foo zp
data Dict :: Constrain... |
ec580b895c71f1e877a96a81ea14db51bc07b904ff02151f04b7271fd14dd877 | duo-lang/duo-lang | Types.hs | module Pretty.Types where
import Data.List (intersperse)
import Data.List.NonEmpty qualified as NE
import Prettyprinter
import Pretty.Common ()
import Pretty.Pretty
import Syntax.RST.Types qualified as RST
import Syntax.CST.Types qualified as CST
import Syntax.TST.Types qualified as TST
import Syntax.CST.Names
import... | null | https://raw.githubusercontent.com/duo-lang/duo-lang/926c8e843687ee408027c21483aa2369b4cd0580/src/Pretty/Types.hs | haskell | -------------------------------------------------------------------------------
Symbols used in the prettyprinting of types
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Names and Operators
--------------... | module Pretty.Types where
import Data.List (intersperse)
import Data.List.NonEmpty qualified as NE
import Prettyprinter
import Pretty.Common ()
import Pretty.Pretty
import Syntax.RST.Types qualified as RST
import Syntax.CST.Types qualified as CST
import Syntax.TST.Types qualified as TST
import Syntax.CST.Names
import... |
f20d163d187edb7baf2011f9321906f3278240fad8e731ff7908202f82566658 | johnlawrenceaspden/hobby-code | efficiencyandprogress3.clj | ;; Efficiency and Progress III : How Close Can We Get to C Speeds?
;; When messing about trying to make clojure quick, it's often well to have
(set! *warn-on-reflection* true)
A kind commenter on my previous post ( ) made me aware of the
;; -march=native option for gcc which allows it to optimize for the
;; partic... | null | https://raw.githubusercontent.com/johnlawrenceaspden/hobby-code/48e2a89d28557994c72299962cd8e3ace6a75b2d/efficiencyandprogress3.clj | clojure | Efficiency and Progress III : How Close Can We Get to C Speeds?
When messing about trying to make clojure quick, it's often well to have
-march=native option for gcc which allows it to optimize for the
particular platform it's compiled on.
On my little netbook, this doubles the speed of the C program to
This is d... |
(set! *warn-on-reflection* true)
A kind commenter on my previous post ( ) made me aware of the
8.6 seconds , so it looks like C can add two vectors of a million
integers to one another , and then add all the entries in the
result , in around 9 milliseconds .
On the other hand , another commenter , point... |
49a7a6088c125888697ee66baf649d32646c81ca8ff66533de3570458cce594a | lamdu/lamdu | DataFiles.hs | module Tests.DataFiles (test) where
import qualified Data.ByteString as BS
import qualified Data.Set as Set
import qualified Distribution.PackageDescription as Cabal
import qualified Distribution.PackageDescription.Parsec as CabalParse
import qualified System.Directory as Directory
import System.FilePath ((<... | null | https://raw.githubusercontent.com/lamdu/lamdu/d9aabd4569270470f83e00f1972ed8b5163a17d8/test/Tests/DataFiles.hs | haskell | module Tests.DataFiles (test) where
import qualified Data.ByteString as BS
import qualified Data.Set as Set
import qualified Distribution.PackageDescription as Cabal
import qualified Distribution.PackageDescription.Parsec as CabalParse
import qualified System.Directory as Directory
import System.FilePath ((<... | |
dde9cf52e7f1314aa0f8345d418f02e51bd3eeb9af91b873978cab7c0522e5ba | mstewartgallus/hs-callbypushvalue | Core.hs | # LANGUAGE TypeOperators #
module Core
( minus,
plus,
)
where
import qualified Data.Text as T
import Global
import Name
import SystemF.Type
plus :: Global (U64 ~> U64 ~> U64)
plus = Global inferType $ Name (T.pack "core") (T.pack "+")
minus :: Global (U64 ~> U64 ~> U64)
minus = Global inferType $ Name (T.pa... | null | https://raw.githubusercontent.com/mstewartgallus/hs-callbypushvalue/d8770b7e9e444e1261901f5ee435fcefb0f7ad75/src/Core.hs | haskell | strictPlus :: Global (U64 ~> U64 ~> F U64)
strictPlus = Global inferAlgebra $ Name (T.pack "core") (T.pack "+!") | # LANGUAGE TypeOperators #
module Core
( minus,
plus,
)
where
import qualified Data.Text as T
import Global
import Name
import SystemF.Type
plus :: Global (U64 ~> U64 ~> U64)
plus = Global inferType $ Name (T.pack "core") (T.pack "+")
minus :: Global (U64 ~> U64 ~> U64)
minus = Global inferType $ Name (T.pa... |
542da5fa7e76cc576ecabc570d0ca0040aa701d248257618c1cce81f1fc95c8b | joinr/spork | trackbar.clj | Feb 2012
;the beginnings of a small utility to create track bars....specifically, to
;show timed events along a horizontal axis.
;I'd like for users to be able to define an event,
;and then add instances of it to a horizontal track representing time.
;Not sure how to abstract time yet, probably stick with inte... | null | https://raw.githubusercontent.com/joinr/spork/bb80eddadf90bf92745bf5315217e25a99fbf9d6/obe/cljgui/components/trackbar.clj | clojure | the beginnings of a small utility to create track bars....specifically, to
show timed events along a horizontal axis.
I'd like for users to be able to define an event,
and then add instances of it to a horizontal track representing time.
Not sure how to abstract time yet, probably stick with integral values for
now... | Feb 2012
First task is to render and event , on a scrollable axis .
Class A events happen at time 10 , 20 , 30 , each for duration of 5 .
draw a scrollable horizontal panel , with 3 rectangular boxes , each the same
unit height , and 5 units of length .
(ns spork.cljgui.trackbar
(:use [cljgui gui asyncdr... |
80dc3ce513d226cb0ed4c01f272f995604b67e8c5d11c8a4328a98a7f2f14f3b | input-output-hk/cardano-wallet | Operations.hs | # LANGUAGE FlexibleContexts #
module Cardano.Wallet.Submissions.Properties.Operations
( properties
) where
import Prelude
import Cardano.Wallet.Submissions.Operations
( Operation (..) )
import Cardano.Wallet.Submissions.Properties.Common
( Step (Step), forAllIn, that, verify )
import Cardano.Wallet.S... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/2540bd3781686d4e1ef5ba01833b62a96680e467/lib/wallet/src/Cardano/Wallet/Submissions/Properties/Operations.hs | haskell | | As described in the specification:
For every transaction in the data structure,
The comparison to 'finality' and 'tip'
will partition the transaction statuses. | # LANGUAGE FlexibleContexts #
module Cardano.Wallet.Submissions.Properties.Operations
( properties
) where
import Prelude
import Cardano.Wallet.Submissions.Operations
( Operation (..) )
import Cardano.Wallet.Submissions.Properties.Common
( Step (Step), forAllIn, that, verify )
import Cardano.Wallet.S... |
9b1be6e911fad6dc990d582f054fc01f67399530841f5cb2b7f80ea7bb67f2cb | jscrane/jvml | optim.clj | (ns ml.optim
(:gen-class )
(:import (incanter Matrix)
(mlclass.fmincg Tuple CostFunction Fmincg))
(:use (incanter core)))
(defn gradient-descent
"
Performs gradient descent to find the model parameters which minimize the given cost function.
initial-theta: the initial model parameters.
Option... | null | https://raw.githubusercontent.com/jscrane/jvml/844eb267150564a3a0f882edbbd505ce94924c8f/src/main/clojure/ml/optim.clj | clojure | if it is not a matrix, it's assumed to be a sequence | (ns ml.optim
(:gen-class )
(:import (incanter Matrix)
(mlclass.fmincg Tuple CostFunction Fmincg))
(:use (incanter core)))
(defn gradient-descent
"
Performs gradient descent to find the model parameters which minimize the given cost function.
initial-theta: the initial model parameters.
Option... |
6a36bc5bffe4ba19942e35844489dbda198e04f75fcf2c88bc8a7a12a24bd678 | cronokirby/haskell-in-haskell | 0025.hs | -- OUT(2222)
x = 1000 + 100 + 10 + 1
main = x + x
| null | https://raw.githubusercontent.com/cronokirby/haskell-in-haskell/83cb8114c7a71f2fc530d1865dd22776a3779417/integration_tests/0025.hs | haskell | OUT(2222) | x = 1000 + 100 + 10 + 1
main = x + x
|
86b4cbf410f8b8c156d6178a3ae78f07c5d9c29bc9f455b66b1f24807dd99053 | alex-hhh/ActivityLog2 | main.rkt | #lang racket/base
;; utilities.rkt -- various utilities
;;
;; This file is part of ActivityLog2, an fitness activity tracker
Copyright ( C ) 2015 , 2019 , 2020 , 2022 < >
;;
;; This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published b... | null | https://raw.githubusercontent.com/alex-hhh/ActivityLog2/e15fd4eea969e81804e33fc5cbc8174adf9e9386/pkgs/the-application/main.rkt | racket | utilities.rkt -- various utilities
This file is part of ActivityLog2, an fitness activity tracker
This program is free software: you can redistribute it and/or modify it
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
without even the implied warranty of MERCHANTA... | #lang racket/base
Copyright ( C ) 2015 , 2019 , 2020 , 2022 < >
under the terms of the GNU General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option )
(require racket/contract
racket/file)
(provide/contract
(data-directory (-> path-s... |
e9e5cd9981666cdfeb3eadd96d7b9dda87661383e8b27ede69fe7b846da8ab5a | l-x/deeperl | deeperl_target_languages.erl | @private
-module(deeperl_target_languages).
-behaviour(gen_deeperl_method).
%% API
-export([request/1, response/1]).
request({}) ->
{
post,
{
"/v2/languages",
[],
"application/x-www-form-urlencoded; charset=utf-8",
"type=target"
}
}.
r... | null | https://raw.githubusercontent.com/l-x/deeperl/834fd8101e7057e090d5ab17b2a68c75f8e1656f/src/deeperl_target_languages.erl | erlang | API | @private
-module(deeperl_target_languages).
-behaviour(gen_deeperl_method).
-export([request/1, response/1]).
request({}) ->
{
post,
{
"/v2/languages",
[],
"application/x-www-form-urlencoded; charset=utf-8",
"type=target"
}
}.
response... |
5a92e970a8f86ed7859f550b4174ad36eaec61efbc32835204a9efcac9d2b61e | ocaml-multicore/parafuzz | ephetest.ml | (* TEST
*)
let debug = false
open Printf
open Ephemeron
let is_true test s b = printf "%s %s: %s\n" test s (if b then "OK" else "FAIL")
let is_false test s b = is_true test s (not b)
let is_data_value test eph (v:int) =
match K1.get_data_copy eph with
| Some x ->
if !x = v
then printf "%s data set: ... | null | https://raw.githubusercontent.com/ocaml-multicore/parafuzz/6a92906f1ba03287ffcb433063bded831a644fd5/testsuite/tests/weak-ephe-final/ephetest.ml | ocaml | TEST
* test: key alive data dangling
* test: key dangling data dangling
* test: key dangling data alive
* test: key accessible from data but all dangling |
let debug = false
open Printf
open Ephemeron
let is_true test s b = printf "%s %s: %s\n" test s (if b then "OK" else "FAIL")
let is_false test s b = is_true test s (not b)
let is_data_value test eph (v:int) =
match K1.get_data_copy eph with
| Some x ->
if !x = v
then printf "%s data set: OK\n" test
... |
d5c08a4857dc8300ab6b8442d927e088b666d33b2b63adeb471c86c913930d82 | cxphoe/SICP-solutions | 2.44.rkt | (define (up-split painter n)
(if (= n 0)
painter
(let ((smaller (up-split painter (- n 1))))
(below painter (beside smaller smaller))))) | null | https://raw.githubusercontent.com/cxphoe/SICP-solutions/d35bb688db0320f6efb3b3bde1a14ce21da319bd/Chapter%202-Building%20Abstractions%20with%20Data/2.Hierarchical%20Data%20and%20the%20Closure%20Property/2.44.rkt | racket | (define (up-split painter n)
(if (= n 0)
painter
(let ((smaller (up-split painter (- n 1))))
(below painter (beside smaller smaller))))) | |
8cebcb7fe95847a2a63e08fcc0c7bb3bf92bd146472a844c3e7bfc2e6a631ddf | scrintal/heroicons-reagent | signal_slash.cljs | (ns com.scrintal.heroicons.solid.signal-slash)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M2.47 2.47a.75.75 0 011.06 0l8.407 8.407a1.125 1.125 0 011.186 1.186l1.462 1.... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/solid/signal_slash.cljs | clojure | (ns com.scrintal.heroicons.solid.signal-slash)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M2.47 2.47a.75.75 0 011.06 0l8.407 8.407a1.125 1.125 0 011.186 1.186l1.462 1.... | |
5596432b9870dfb06c0211758a0bac698c4830b633c311bd7bfb481d75ed96a2 | fmw/alida | crawl.clj | test / / test / crawl.clj : tests for crawling functions
;;
Copyright 2012 , F.M. de Waard & Vixu.com < > .
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; U... | null | https://raw.githubusercontent.com/fmw/alida/32be687a563e31a8ebad718de8f4c4aa36faf95d/test/alida/test/crawl.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | test / / test / crawl.clj : tests for crawling functions
Copyright 2012 , F.M. de Waard & Vixu.com < > .
distributed under the License is distributed on an " AS IS " BASIS ,
(ns alida.test.crawl
(:use [clojure.test]
[clj-http.fake]
[alida.test.helpers
:only [with-test-db
... |
3144f6ae6d17520505bd84a892a187e636f12e40ed90df7e2db40e33d104f0a9 | haskell/haskell-language-server | Database.hs | -- We deliberately want to ensure the function we add to the rule database
-- has the constraints we need on it when we get it out.
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
{-# LANGUAGE DerivingStrategies #-}
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE R... | null | https://raw.githubusercontent.com/haskell/haskell-language-server/94cd24d9e43a0f93f947075bb5a931b5d92a9f61/hls-graph/src/Development/IDE/Graph/Internal/Database.hs | haskell | We deliberately want to ensure the function we add to the rule database
has the constraints we need on it when we get it out.
# OPTIONS_GHC -Wno-redundant-constraints #
# LANGUAGE DerivingStrategies #
# LANGUAGE RankNTypes #
| Increment the step and mark dirty.
Assumes that the database is... |
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns #
module Development.IDE.Graph.Internal.Database (newDatabase, incDatabase,... |
cd84334f56e799fc663b9f617e63742499825ea7773e510a33836fccabf1b5b6 | EligiusSantori/L2Apf | select_character.scm | (module system racket/base
(provide game-client-packet/select-character)
(require "../../packet.scm")
(define (game-client-packet/select-character struct)
(let ((s (open-output-bytes)))
(begin
(write-byte #x0d s)
(write-int32 (cdr (assoc 'id struct)) #f s)
(write-bytes (make-bytes 16) s)
... | null | https://raw.githubusercontent.com/EligiusSantori/L2Apf/30ffe0828e8a401f58d39984efd862c8aeab8c30/packet/game/client/select_character.scm | scheme | (module system racket/base
(provide game-client-packet/select-character)
(require "../../packet.scm")
(define (game-client-packet/select-character struct)
(let ((s (open-output-bytes)))
(begin
(write-byte #x0d s)
(write-int32 (cdr (assoc 'id struct)) #f s)
(write-bytes (make-bytes 16) s)
... | |
b0964ffbb12fae6f88a38cc352ddb5e803b7864d69259642720ea5140f83b367 | msakai/toysolver | PB.hs | # OPTIONS_GHC -Wall #
{-# OPTIONS_HADDOCK show-extensions #-}
{-# LANGUAGE BangPatterns #-}
# LANGUAGE TypeFamilies #
-----------------------------------------------------------------------------
-- |
-- Module : ToySolver.Converter.PB
Copyright : ( c ) 2013,2016 - 2018
-- License : BSD-style
--
-- ... | null | https://raw.githubusercontent.com/msakai/toysolver/8518e7782b888f851e889f28b518edbcdee52bde/src/ToySolver/Converter/PB.hs | haskell | # OPTIONS_HADDOCK show-extensions #
# LANGUAGE BangPatterns #
---------------------------------------------------------------------------
|
Module : ToySolver.Converter.PB
License : BSD-style
Maintainer :
Stability : experimental
Portability : non-portable
-------------------------------------... | # OPTIONS_GHC -Wall #
# LANGUAGE TypeFamilies #
Copyright : ( c ) 2013,2016 - 2018
module ToySolver.Converter.PB
( module ToySolver.Converter.Base
, module ToySolver.Converter.Tseitin
* Normalization of PB / WBO problems
, normalizePB
, normalizeWBO
* Linealization of PB / WBO problems
, linear... |
7bc0b7c10a7181ad3a55ac4371930bf99032c8ca5e14b587950479f4ada343c1 | clojure-emacs/cider-nrepl | stacktrace_test.clj | (ns cider.nrepl.middleware.stacktrace-test
(:require
[cider.nrepl.middleware.stacktrace :as sut :refer :all]
[cider.nrepl.test-session :as session]
[clojure.test :refer :all]))
(use-fixtures :each session/session-fixture)
Stacktrace op ( deprecated )
(deftest stacktrace-bound-test
(testing "stacktrace... | null | https://raw.githubusercontent.com/clojure-emacs/cider-nrepl/1fa95f24d45af4181e5c1ce14bfa5fa97ff3a065/test/clj/cider/nrepl/middleware/stacktrace_test.clj | clojure | Analyze last stacktrace op
Analyze stacktrace op | (ns cider.nrepl.middleware.stacktrace-test
(:require
[cider.nrepl.middleware.stacktrace :as sut :refer :all]
[cider.nrepl.test-session :as session]
[clojure.test :refer :all]))
(use-fixtures :each session/session-fixture)
Stacktrace op ( deprecated )
(deftest stacktrace-bound-test
(testing "stacktrace... |
fc74767d92ee2b7d2214ed0557740bd014cf31c656f8ebf4e6c3fa0eac6ef674 | kupl/FixML | sub3.ml | let rec change : int list -> int -> int
= fun coins amount ->
let rec coin_reduce lst v =
match lst with
| [] -> 0
| hd::tl -> if (v-hd) = 0 then 1 else if (v-hd) < 0 then 0 else coin_reduce tl v + coin_reduce lst (v-hd)
in
if amount = 0 then(if coins = [] then 0 else 1)
else if amount < 0 then 0
else... | null | https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/coinchange/coinchange/submissions/sub3.ml | ocaml | let rec change : int list -> int -> int
= fun coins amount ->
let rec coin_reduce lst v =
match lst with
| [] -> 0
| hd::tl -> if (v-hd) = 0 then 1 else if (v-hd) < 0 then 0 else coin_reduce tl v + coin_reduce lst (v-hd)
in
if amount = 0 then(if coins = [] then 0 else 1)
else if amount < 0 then 0
else... | |
b1f9c334eeb6450b779ce0d50962327032d521f6dbc00f90357a7758e2f031ac | whalliburton/language | iso-639.lisp | (in-package :language)
(defparameter *iso-639-language-codes*
'(("ab" "abk" "abkhaze" "Abkhazian" "Abkhazian")
(NIL "ace" "aceh" "Achinese" "Achinese")
(NIL "ach" "acoli" "Acoli" "Acoli")
(NIL "ada" "adangme" "Adangme" "Adangme")
(NIL "ady" "adyghé" "Adyghe; Adygei" "Adygei")
("aa" "aar" "afar" "... | null | https://raw.githubusercontent.com/whalliburton/language/d16ddf05c2b7e067f6f9ce74416c73f0b64b63c4/iso-639.lisp | lisp | (in-package :language)
(defparameter *iso-639-language-codes*
'(("ab" "abk" "abkhaze" "Abkhazian" "Abkhazian")
(NIL "ace" "aceh" "Achinese" "Achinese")
(NIL "ach" "acoli" "Acoli" "Acoli")
(NIL "ada" "adangme" "Adangme" "Adangme")
(NIL "ady" "adyghé" "Adyghe; Adygei" "Adygei")
("aa" "aar" "afar" "... | |
785a5e45e6c24de1a80fdcf5795ff19d23e52701320f45e50806274a6f028069 | icicle-lang/icicle-ambiata | Eval.hs | -- | Evaluation of Source programs.
--
--
-- Note: Numbers
-- ~~~~~~~~~~~~~
Perhaps surprisingly , the LitInt primitive does not necessarily return an Int .
-- Its type is "forall a. Num a => a", because it can be used as either an Int or a Double.
This means that when simply looking at a " LitInt n " , it is not k... | null | https://raw.githubusercontent.com/icicle-lang/icicle-ambiata/9b9cc45a75f66603007e4db7e5f3ba908cae2df2/icicle-source/src/Icicle/Source/Eval.hs | haskell | | Evaluation of Source programs.
Note: Numbers
~~~~~~~~~~~~~
Its type is "forall a. Num a => a", because it can be used as either an Int or a Double.
As a workaround, just to simplify the evaluator, ALL numbers are treated as VDouble.
Latest can return either an array or a value, depending on the temporality... | Perhaps surprisingly , the LitInt primitive does not necessarily return an Int .
This means that when simply looking at a " LitInt n " , it is not known whether
it should evaluate to " VInt n " or " VDouble n " .
Operators like ( + ) , ( * ) etc are polymorphic and can operate on Ints or Doubles .
However bec... |
b8e9282cff83860401bb1bfbf25f931354b7e7cc5d52c8f95ffee3b35473b4ea | ghcjs/ghcjs-boot | Generics.hs | {-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP #-}
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE TypeOperators #-}
# LANGUAGE KindSignatures #
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LA... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-boot/8c549931da27ba9e607f77195208ec156c840c8a/boot/base/GHC/Generics.hs | haskell | # LANGUAGE Trustworthy #
# LANGUAGE CPP #
# LANGUAGE TypeSynonymInstances #
# LANGUAGE TypeOperators #
# LANGUAGE TypeFamilies #
# LANGUAGE StandaloneDeriving #
# LANGUAGE DeriveGeneric #
--------------------------------------------------------------------... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE KindSignatures #
Copyright : ( c ) Universiteit Utrecht 2010 - 2011 , University of Oxford 2012 - 2013
@since 4.6.0.0
module GHC.Generics (
Datatype - generic functions are are based on the idea of converting values of
Representable types are coll... |
dc5b90df90d25eccca0882c70d63ed87db0e08756dcb0dd6c506c16899b8f404 | nh2/hatrace | HatraceSpec.hs | # LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE CPP #
# LANGUAGE LambdaCase #
module HatraceSpec where
import Control.Monad (when)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.IO.... | null | https://raw.githubusercontent.com/nh2/hatrace/7258134d87915f035efd36babc685c80fb1df8cc/test/HatraceSpec.hs | haskell | # LANGUAGE OverloadedStrings #
| Assertion we run before each test to ensure no leftover child processes
that could affect subsequent tests.
This is obviously not effective if tests were to run in parallel.
Note we use `before_` instead of `after_` above because apparently,
`after_` action fails as well, showing ... | # LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE CPP #
# LANGUAGE LambdaCase #
module HatraceSpec where
import Control.Monad (when)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.IO.Unlift (MonadUnliftIO)
import ... |
cedbdfe11227bd77a5ee6a09eda4ef399498c596cdc79bcbc8057a074efdec98 | gwathlobal/CotD | init-lvl-mod-time-of-day.lisp | (in-package :cotd)
;;---------------------------------
Time of Day level modifiers
;;---------------------------------
(set-level-modifier :id +lm-tod-morning+ :type :level-mod-tod
:name "Morning"
:overall-post-process-func-list #'(lambda ()
... | null | https://raw.githubusercontent.com/gwathlobal/CotD/d01ef486cc1d3b21d2ad670ebdb443e957290aa2/src/level-modifiers/init-lvl-mod-time-of-day.lisp | lisp | ---------------------------------
---------------------------------
is not available for hell districts
is not available for hell districts
is not available for hell districts
is not available for hell districts
is only available for hell districts | (in-package :cotd)
Time of Day level modifiers
(set-level-modifier :id +lm-tod-morning+ :type :level-mod-tod
:name "Morning"
:overall-post-process-func-list #'(lambda ()
(let ((func-list ()))
... |
44f2bbdb90ed16d16462325f4facacde39bb7334770126436b14114516f78fcd | skanev/playground | 30.scm | SICP exercise 1.30
;
; The sum procedure above generates a linear recursion. The procedure can be
; rewritten so that the sum is performed iteratively. Show how to do this
; by filling in the missing expressions in the following definition:
;
; (define (sum term a next b)
; (define (iter a result)
; (if <??>
; ... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/01/30.scm | scheme |
The sum procedure above generates a linear recursion. The procedure can be
rewritten so that the sum is performed iteratively. Show how to do this
by filling in the missing expressions in the following definition:
(define (sum term a next b)
(define (iter a result)
(if <??>
<??>
(iter <?... | SICP exercise 1.30
(define (sum term a next b)
(define (iter a result)
(if (> a b)
result
(iter (next a) (+ (term a) result))))
(iter a 0))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.