_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 |
|---|---|---|---|---|---|---|---|---|
fb94dbbe176243729e55d08a6528b323fac86cd1bc0f4f3bb3516acf61f41b33 | tel/serv | Api.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableIns... | null | https://raw.githubusercontent.com/tel/serv/7967761d6c47f13f0edd567f8af9b1c7dc8b9a23/serv/src/Serv/Api.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE GADTs #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
| Types, but really kinds, which represent the structure of an API.
* API types/kinds
** Syntax sugar
* Singletons
* Type aliases
** 'Api'
** '... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module Serv.Api (
Api (..)
, Path (..)
, Handler (..)
, Output (..)
, Body (..)
, type (:::)
, Sing (
SEndpoint, SOneOf, SAbstract, (:%>)
, SConst... |
c4f716d5c67f10f9f61060721a918a1b807b612a437ff2739404430d0ab79aaf | pbevin/cardelli | Main.hs | import System.Console.Haskeline
import AST
import Analyze
import Parse
import ParseType
import ShowExpr
import Test.QuickCheck
import ASTGen
import Simplify
main = hello >> readEvalPrintLoop
hello :: IO ()
hello = do
putStrLn "Fun Type Inferencer"
readEvalPrintLoop :: IO ()
readEvalPrintLoop = runInputT defaultSe... | null | https://raw.githubusercontent.com/pbevin/cardelli/bf239351289d379796fa68c25bb6c56be0e67925/hs/Main.hs | haskell | import System.Console.Haskeline
import AST
import Analyze
import Parse
import ParseType
import ShowExpr
import Test.QuickCheck
import ASTGen
import Simplify
main = hello >> readEvalPrintLoop
hello :: IO ()
hello = do
putStrLn "Fun Type Inferencer"
readEvalPrintLoop :: IO ()
readEvalPrintLoop = runInputT defaultSe... | |
27b94e2fc99d33bf2402b042e4747285190c00f7e4093da0bd3feb271bd84053 | bradparker/servant-beam-realworld-example-app | Database.hs | module RealWorld.Conduit.Spec.Database
( withConnection
) where
import Control.Exception (bracket)
import Data.ByteString.Char8 (pack)
import Database.PostgreSQL.Simple (Connection, begin, close, rollback)
import RealWorld.Conduit.Database (openConduitDb)
import System.Environment (getEnv)
withConnection :: (Conn... | null | https://raw.githubusercontent.com/bradparker/servant-beam-realworld-example-app/d4a0d79d9dbc7e5b8987b367ac32f99ac3cc20e7/spec/RealWorld/Conduit/Spec/Database.hs | haskell | module RealWorld.Conduit.Spec.Database
( withConnection
) where
import Control.Exception (bracket)
import Data.ByteString.Char8 (pack)
import Database.PostgreSQL.Simple (Connection, begin, close, rollback)
import RealWorld.Conduit.Database (openConduitDb)
import System.Environment (getEnv)
withConnection :: (Conn... | |
3868b7df2978ebfbe0b3db0c9634e3036489dc549473e9825be8db1247ba4c3d | valis/hoq | Telescopes.hs | # LANGUAGE ExistentialQuantification #
module TypeChecking.Expressions.Telescopes
( typeCheckTelescope
, SomeEq(..)
, replaceSort
, findOccurrence
) where
import Data.Void
import Data.Bifoldable
import Syntax as S
import Semantics
import Semantics.Value as V
import TypeChecking.Monad
import TypeC... | null | https://raw.githubusercontent.com/valis/hoq/9d2d2f5dee367ca5a609199856ca5964499bf33a/src/TypeChecking/Expressions/Telescopes.hs | haskell | # LANGUAGE ExistentialQuantification #
module TypeChecking.Expressions.Telescopes
( typeCheckTelescope
, SomeEq(..)
, replaceSort
, findOccurrence
) where
import Data.Void
import Data.Bifoldable
import Syntax as S
import Semantics
import Semantics.Value as V
import TypeChecking.Monad
import TypeC... | |
5437c9fc757f38c7446b823dc5281889ae9adc5612460dec225fb73013302e4b | yrashk/ocaml-traits | type_int.ml | include Int
module PartialEq = Partial_eq.Make (struct
type t = int
type rhs = int
let eq = Int.equal
end)
module Eq = Eq.Make (PartialEq)
module PartialOrd = struct
type t = int
type rhs = int
let partial_cmp x y =
Ordering.(
Some
(match Int.compare x y with
| -1 -> Less
... | null | https://raw.githubusercontent.com/yrashk/ocaml-traits/460f43f37c2ffc9b138fde434e6b787dffab9070/lib/type_int.ml | ocaml | include Int
module PartialEq = Partial_eq.Make (struct
type t = int
type rhs = int
let eq = Int.equal
end)
module Eq = Eq.Make (PartialEq)
module PartialOrd = struct
type t = int
type rhs = int
let partial_cmp x y =
Ordering.(
Some
(match Int.compare x y with
| -1 -> Less
... | |
6a9d0cb9a2d6fa89332ffae9c0d3a71fce63d59a9f11d939f55a4610bc629b93 | gdevanla/write-you-a-python-lexer | LexerUtil.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE MultiWayIf#-}
module Example1.LexerUtil where
import RIO
import qualified Data.Text as T
import Codec.Binary.UTF8.String as UTF8 (encode)
import qualified Data.List as L
import Example1.Tokens
first step is... | null | https://raw.githubusercontent.com/gdevanla/write-you-a-python-lexer/b07bd85df1f29e4505d4f52e975ae0d9dc8a3605/src/Example1/LexerUtil.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE MultiWayIf#
Going with general practices(wrapper examples), we will have the following
We dont' use it in our examples | # LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
module Example1.LexerUtil where
import RIO
import qualified Data.Text as T
import Codec.Binary.UTF8.String as UTF8 (encode)
import qualified Data.List as L
import Example1.Tokens
first step is to decide what our type is going to be .
type Byte = Word8
... |
8bf2be0197311af3a4deb8cb1c77aebbde43f2764ac08b879142cc46f684ebc5 | arrdem/oxcart | vars.clj | Copyright ( c ) , Rich Hickey & contributors . The use
;; and distribution terms for this software are covered by the
;; Eclipse Public License 1.0
;; (-1.0.php) which can be
;; found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to... | null | https://raw.githubusercontent.com/arrdem/oxcart/38c3247dabe904b3c067385a7d64c5f4f65ccc09/src/main/clojure/oxcart/vars.clj | clojure | and distribution terms for this software are covered by the
Eclipse Public License 1.0
(-1.0.php) which can be
found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be
bound by the terms of this license. You must not remove this
... | Copyright ( c ) , Rich Hickey & contributors . The use
(ns oxcart.vars
(:refer-clojure :exclude [*loaded-libs*]))
(def ^:dynamic *loaded-libs*
"A set, being those namespaces which have been loaded in compilation
context. Note that this set has no relationship with
clojure.core/*loaded-libs*, meaning th... |
5cb1344f21ca0ad02f076c774947fe858a9db4ea7a04d0648122b9c51fcc8c06 | steshaw/PLAR | meson.ml | (* ========================================================================= *)
Model elimination procedure ( version , based on Stickel 's PTTP ) .
(* *)
Copyright ( c ) 2003 - 2007 , . ( See " LICENSE.txt " for details . )
(* ====... | null | https://raw.githubusercontent.com/steshaw/PLAR/c143b097d1028963f4c1d24f45a1a56c8b65b838/meson.ml | ocaml | =========================================================================
=========================================================================
-------------------------------------------------------------------------
Example of naiv... | Model elimination procedure ( version , based on Stickel 's PTTP ) .
Copyright ( c ) 2003 - 2007 , . ( See " LICENSE.txt " for details . )
START_INTERACTIVE;;
tab <<forall a. ~(P(a) /\ (forall y z. Q(y) \/ R(z)) /\ ~P(a))>>;;
tab <<forall a. ~(P(a) /\ ~P(a) /\ (forall y z. Q(y) \/ R(z)))>>;;
Unfortu... |
5f49a8bbc06f5bee34cd70de090c94ca3732643d2eebe587cd25de8054f93238 | ahf/ircd-scylla | utils.mli |
* Copyright ( c ) 2015 . All rights reserved .
* Use of this source code is governed by a BSD - style
* license that can be found in the LICENSE file .
* Copyright (c) 2015 Alexander Færøy. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICE... | null | https://raw.githubusercontent.com/ahf/ircd-scylla/d06bfa61cd75a44c4f5493f316fba23143c32a78/utils.mli | ocaml |
* Copyright ( c ) 2015 . All rights reserved .
* Use of this source code is governed by a BSD - style
* license that can be found in the LICENSE file .
* Copyright (c) 2015 Alexander Færøy. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICE... | |
5ba17843cf56f93e74fe3896ad40d762ca3a1cde63f3f639c54e1b6a50596d2a | input-output-hk/cardano-wallet | local-cluster.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NumericUnderscores #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Main where
import Prelude
import Cardano.BM.Data.Severity
( Severity (..) )
impor... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/c4af01b952268b57d3fcd1a0cb476d77dba4f166/lib/wallet/exe/local-cluster.hs | haskell | |
# OVERVIEW
This starts a cluster of Cardano nodes with:
- 1 relay node
- 4 stake pools
once pools are registered and up-and-running, an instance of cardano-wallet
is started.
| # | Pledge | Retirement | Metadata |
| --- | --- | --- | --- |
| Pool #0 | 2M A... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NumericUnderscores #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Main where
import Prelude
import Cardano.BM.Data.Severity
( Severity (..) )
impor... |
217bc800a2aac74fb6ff2f308b93e6728dd140c1f5b14fcbc94c1c3136efd637 | camlp5/pa_ppx_ag | test1_ast.ml | (* camlp5o *)
test1_ast.ml
type expr =
INT of int
| BINOP of binop * expr * expr
| UNOP of unop * expr
| REF of string
| ASSIGN of string * expr
| SEQ of expr * expr
and unop = UPLUS | UMINUS
and binop = PLUS | MINUS | STAR | SLASH | PERCENT
and block1 = BLOCK1 of block2
and block2 = BLOCK2 of expr
and... | null | https://raw.githubusercontent.com/camlp5/pa_ppx_ag/befb76d71f2ea432dc7b53ac80552fdd62985605/tests/simple_expr/test1_ast.ml | ocaml | camlp5o | test1_ast.ml
type expr =
INT of int
| BINOP of binop * expr * expr
| UNOP of unop * expr
| REF of string
| ASSIGN of string * expr
| SEQ of expr * expr
and unop = UPLUS | UMINUS
and binop = PLUS | MINUS | STAR | SLASH | PERCENT
and block1 = BLOCK1 of block2
and block2 = BLOCK2 of expr
and prog = PROG o... |
703799faae4f17ac2721ae0167e29376a876765e9aaf47280452e26561924018 | jellelicht/guix | snix.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 , 2013 , 2015 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/tests/snix.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2012 , 2013 , 2015 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (test-snix)
#:use-module (guix import snix)
#:use-module (srfi srfi-1)
#:use-mo... |
0e972626be38ea1b843f781b522c3f44c255493554597d4e6ac6436149aa2f15 | kappelmann/engaging-large-scale-functional-programming | Exercise03.hs | module Exercise03 where
primeMayor :: Integer -> Integer
primeMayor n | even n = 2
| primeTest n = 1
| primeTest (n-2) = 2
| otherwise = 3
primeTest :: Integer -> Bool
primeTest n = not $ any (\x -> n `mod` x == 0) [2..n`div`2]
| null | https://raw.githubusercontent.com/kappelmann/engaging-large-scale-functional-programming/8ed2c056fbd611f1531230648497cb5436d489e4/resources/contest/example_data/03/uploads/tumbum/Exercise03.hs | haskell | module Exercise03 where
primeMayor :: Integer -> Integer
primeMayor n | even n = 2
| primeTest n = 1
| primeTest (n-2) = 2
| otherwise = 3
primeTest :: Integer -> Bool
primeTest n = not $ any (\x -> n `mod` x == 0) [2..n`div`2]
| |
4a35c79ae895df472f7deb7c0f932ce412c9bfb146859c529816af4dce110b44 | tisnik/clojure-examples | module_a.clj | (ns codoxtest.module-a
"Popis modulu se jmenem 'module-a'")
(defn f1
"Popis funkce f1."
[])
(defn f2
"Popis funkce f2."
[x]
(inc x))
(defn f3
"Popis funkce f2."
[x y]
(+ x y))
(def answer
"The Answer to the Ultimate Question of Life, the Universe, and Everything"
42)
(de... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/984af4a3e20d994b4f4989678ee1330e409fdae3/codoxtest/src/codoxtest/module_a.clj | clojure | (ns codoxtest.module-a
"Popis modulu se jmenem 'module-a'")
(defn f1
"Popis funkce f1."
[])
(defn f2
"Popis funkce f2."
[x]
(inc x))
(defn f3
"Popis funkce f2."
[x y]
(+ x y))
(def answer
"The Answer to the Ultimate Question of Life, the Universe, and Everything"
42)
(de... | |
15e74fad3b09be5f0b46e004074b2c3e12abd8f30bdc23c5a8999f67f383ce34 | brendanhay/gogol | List.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-monitoring/gen/Gogol/Monitoring/Services/ServiceLevelObjectives/List.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
/See:/ </ Cloud Monitoring API Reference> for @monitoring.services.serviceLevelObjectives.list@.
* Resource
** Constructing a Request
| A resource alias for @monitoring.services.serviceLevelObjectives.list@ method which the
'... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
e1bb03615f91ac5262eff84407a4c9aea87270b2607e9f54371242d5d1e6b6be | vollcheck/aoc | day01.clj | (ns y18.day01
(:require [clojure.string :as str]
[core :refer [load-input in?]]
[purity :refer [defpure]]))
(let [input (load-input)]
(-> input
count))
(transduce
(map parse-long)
+
0
(load-input))
(defn part-1 [input]
(transduce
(map parse-long)
+
0
input))
(get... | null | https://raw.githubusercontent.com/vollcheck/aoc/9605d84ef0b0a3c30c567e7de1b5a2c41a54b996/src/y18/day01.clj | clojure | (ns y18.day01
(:require [clojure.string :as str]
[core :refer [load-input in?]]
[purity :refer [defpure]]))
(let [input (load-input)]
(-> input
count))
(transduce
(map parse-long)
+
0
(load-input))
(defn part-1 [input]
(transduce
(map parse-long)
+
0
input))
(get... | |
07930e584d169c50bf35c299f06c81a324d9a9f282ed83707c15c94ab328a4d7 | arevkov/clojure-web-app | menu.cljs | (ns clojure-web-app.views.menu
(:require [reagent-modals.modals :as modals]))
(defn show-about []
[:div.dialog [:h2 "Clojure-web-app ver 0.0.1"] [:hr] [:div "TODO: write something meaningful here!"]])
Brand and toggle get grouped for better mobile display
[:div.navbar-header
[:button.navbar-toggle
{:ty... | null | https://raw.githubusercontent.com/arevkov/clojure-web-app/95eca4ee40c675c23d03c3137b8a360166eec96d/src/cljs/clojure_web_app/views/menu.cljs | clojure | Collect the nav links, forms, and other content for toggling
Top Menu Items | (ns clojure-web-app.views.menu
(:require [reagent-modals.modals :as modals]))
(defn show-about []
[:div.dialog [:h2 "Clojure-web-app ver 0.0.1"] [:hr] [:div "TODO: write something meaningful here!"]])
Brand and toggle get grouped for better mobile display
[:div.navbar-header
[:button.navbar-toggle
{:ty... |
ecdb545ae21a4adf185a93b5a3e757f10d7ee55ccfbde49da89d2757a2aeb2de | matterandvoid-space/subscriptions | core_test.cljc | (ns space.matterandvoid.subscriptions.core-test
(:require
[clojure.test :refer [deftest is testing use-fixtures]]
[space.matterandvoid.subscriptions.reagent-ratom :as ratom]
[datascript.core :as d]
[taoensso.timbre :as log]
[space.matterandvoid.subscriptions.core :as sut]))
(log/set-level! :debug... | null | https://raw.githubusercontent.com/matterandvoid-space/subscriptions/686912827bae018a594088bc712d454b78fcdb2e/src/test/space/matterandvoid/subscriptions/core_test.cljc | clojure | sub raw should support multiple forms in the body
this lends itself well for property based tests
implement the same test -> start data -> transact -> expected output
repeat
copy the reverse example from the clojure docs for example
now I want to:
in a loop - make a db that has a lot of data
then
sut/reg-sub
r... | (ns space.matterandvoid.subscriptions.core-test
(:require
[clojure.test :refer [deftest is testing use-fixtures]]
[space.matterandvoid.subscriptions.reagent-ratom :as ratom]
[datascript.core :as d]
[taoensso.timbre :as log]
[space.matterandvoid.subscriptions.core :as sut]))
(log/set-level! :debug... |
1aa2228268c140815b211e5459a126432d10615ac305aaca59a13ed91872da46 | auser/beehive | beehive_db_srv.erl | %%% beehive_db_srv.erl
@author < >
05/28/10 < >
%% @doc Database server
-module (beehive_db_srv).
-behaviour(gen_server).
%% API
-export([
start_link/0, start_link/1, start_link/2,
stop/0,
read/2,
write/3,
delete/2, delete_all/1,
all/1,
run/1,
save/1,
status/0,
match/1,
info/1
]).
%%... | null | https://raw.githubusercontent.com/auser/beehive/dfe257701b21c56a50af73c8203ecac60ed21991/lib/erlang/apps/beehive/src/bh_database/beehive_db_srv.erl | erlang | beehive_db_srv.erl
@doc Database server
API
gen_server callbacks
For testing
====================================================================
API
====================================================================
Get the status of the db
--------------------------------------------------------------------
... | @author < >
05/28/10 < >
-module (beehive_db_srv).
-behaviour(gen_server).
-export([
start_link/0, start_link/1, start_link/2,
stop/0,
read/2,
write/3,
delete/2, delete_all/1,
all/1,
run/1,
save/1,
status/0,
match/1,
info/1
]).
-export([init/1, handle_call/3, handle_cast/2,
... |
d35f023a66bc124696b7b2002c1845222a24712f363df07a959d41b99f7dc4ad | NorfairKing/sydtest | Def.hs | -- | This module exports all the functions you will use to define your test suite.
module Test.Syd.Def
( -- * Rexports
module Test.Syd.Def.Specify,
module Test.Syd.Def.Around,
module Test.Syd.Def.AroundAll,
module Test.Syd.Def.SetupFunc,
module Test.Syd.Def.Golden,
module Test.Syd.Def.Scenario... | null | https://raw.githubusercontent.com/NorfairKing/sydtest/22a7421ba635a18b1bfa750e64c8db5ee8842e5a/sydtest/src/Test/Syd/Def.hs | haskell | | This module exports all the functions you will use to define your test suite.
* Rexports | module Test.Syd.Def
module Test.Syd.Def.Specify,
module Test.Syd.Def.Around,
module Test.Syd.Def.AroundAll,
module Test.Syd.Def.SetupFunc,
module Test.Syd.Def.Golden,
module Test.Syd.Def.Scenario,
module Test.Syd.Def.TestDefM,
)
where
import Test.Syd.Def.Around
import Test.Syd.Def.AroundA... |
7595019eb2dc8ec891b9a7d6cbb8b5d34d0585916317272f03cff1ea3df67a11 | ekmett/ekmett.github.com | Paths_monad_sec.hs | module Paths_monad_sec (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName
) where
import Data.Version
version = Version {versionBranch = [0,0,1], versionTags = []}
bindir = "/usr/local/bin"
libdir = "/usr/local/lib/monad-sec-0.0.1/ghc-6.6.1"
datadir = "/usr/local/share/monad-s... | null | https://raw.githubusercontent.com/ekmett/ekmett.github.com/8d3abab5b66db631e148e1d046d18909bece5893/haskell/security-policy/dist/build/autogen/Paths_monad_sec.hs | haskell | module Paths_monad_sec (
version,
getBinDir, getLibDir, getDataDir, getLibexecDir,
getDataFileName
) where
import Data.Version
version = Version {versionBranch = [0,0,1], versionTags = []}
bindir = "/usr/local/bin"
libdir = "/usr/local/lib/monad-sec-0.0.1/ghc-6.6.1"
datadir = "/usr/local/share/monad-s... | |
644cfa654fac118f0f48e93be45be81d1c6536004e6d82f90dfdc5da405a5eba | mirage/index | test_lru.ml | * Tests of the in - memory LRU used by the Index implementation .
NOTE : most other tests in the suite set an LRU size of 0 for simplicity .
NOTE: most other tests in the suite set an LRU size of 0 for simplicity. *)
module Stats = Index.Stats
open Common
module Context = Common.Make_context (struct
let... | null | https://raw.githubusercontent.com/mirage/index/5222f7e939491269e61915aac910d2f9f99556b4/test/unix/test_lru.ml | ocaml | Remove [k] from the index via [filter], then try to [find] it: | * Tests of the in - memory LRU used by the Index implementation .
NOTE : most other tests in the suite set an LRU size of 0 for simplicity .
NOTE: most other tests in the suite set an LRU size of 0 for simplicity. *)
module Stats = Index.Stats
open Common
module Context = Common.Make_context (struct
let... |
38431caa16d1e11a86a788822df2e1568cd0322d544224b1731a8a8250032529 | gregr/ina | box.scm | ((provide box box? unbox set-box!))
(define (box d) (make-mvector 1 d))
(define (box? d) (and (mvector? d) (= 1 (mvector-length d))))
(define (unbox mv) (mvector-ref mv 0))
(define (set-box! mv d) (mvector-set! mv 0 d))
| null | https://raw.githubusercontent.com/gregr/ina/5e0a5b7ec44c8c9575b22ce5c394f7a96b766545/nscheme/old/old-5/lib/box.scm | scheme | ((provide box box? unbox set-box!))
(define (box d) (make-mvector 1 d))
(define (box? d) (and (mvector? d) (= 1 (mvector-length d))))
(define (unbox mv) (mvector-ref mv 0))
(define (set-box! mv d) (mvector-set! mv 0 d))
| |
0897fbaa9811374eeae84de25f837ab91a7875353bba04d6e656302cbb86f48b | harpocrates/language-rust | Main.hs | module Main where
import System.IO
import LexerTest (lexerSuite)
import ParserTest (parserSuite)
import PrettyTest (prettySuite)
import CompleteTest (completeSuite)
import Test.Framework (defaultMain)
main :: IO ()
main = hSetEncoding stdout utf8 *> defaultMain [ lexerSuite, parserSuite, prettySuite, completeSuite ... | null | https://raw.githubusercontent.com/harpocrates/language-rust/9d509c450d009cc99f1180b3f2f30247dfb1cfce/test/unit-tests/Main.hs | haskell | module Main where
import System.IO
import LexerTest (lexerSuite)
import ParserTest (parserSuite)
import PrettyTest (prettySuite)
import CompleteTest (completeSuite)
import Test.Framework (defaultMain)
main :: IO ()
main = hSetEncoding stdout utf8 *> defaultMain [ lexerSuite, parserSuite, prettySuite, completeSuite ... | |
91e75ca18f05679d6bbac3efd8abc87512aed7e5f81544186cb27fb29c1de7e4 | Clozure/ccl | x8632-numbers.lisp | ;;;
;;; Copyright 2009 Clozure Associates
;;;
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, softw... | null | https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/level-0/X86/X8632/x8632-numbers.lisp | lisp |
Copyright 2009 Clozure Associates
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... | distributed under the License is distributed on an " AS IS " BASIS ,
(in-package "CCL")
(defx8632lapfunction %fixnum-signum ((number arg_z))
(mov ($ '-1) (% temp0))
(mov ($ '1) (% temp1))
(test (% number) (% number))
(cmovs (% temp0) (% arg_z))
(cmovns (% temp1) (% arg_z))
(single-value-return))
(defx8... |
e01da99ee091ce39583b96da5a9f887bc74d380d687d26b88d9ad7cbf61724f0 | racket/old-plt | tag-negate-tests.scm | (define (tag-neg-test ls target-set)
(easy-tag ls #f target-set))
(define (easy-tag ls last-shape target-set)
(cond ((null? ls) #f)
((let ((tst (car ls)))
(and ;(not (action-test? tst))
(not (or (shape-test? tst) (action-test? tst)))
(equal? target-set (test-used-... | null | https://raw.githubusercontent.com/racket/old-plt/a580d75deae2a0d2f3d8a93bc3c4f8f1f619b5b7/collects/mzlib/private/plt-match/tag-negate-tests.scm | scheme | (not (action-test? tst))
(define (move-negates-to-tags ls-of-ls)
(map (lambda (l) (cons (move-neg-to-tag (car l))
(cdr l)))
ls-of-ls))
(define (move-neg-to-tag ls)
(let-values (((list-without-neg-tests neg-tests)
(let loop ((l ls)
(n... | (define (tag-neg-test ls target-set)
(easy-tag ls #f target-set))
(define (easy-tag ls last-shape target-set)
(cond ((null? ls) #f)
((let ((tst (car ls)))
(not (or (shape-test? tst) (action-test? tst)))
(equal? target-set (test-used-set-neg tst))))
(begin
... |
5b08cb0df01b0810c7bb0f1382358b7592391ba69661779aa88b83f8df331fc0 | purebred-mua/purebred | Main.hs | -- This file is part of purebred
Copyright ( C ) 2018
--
-- purebred is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at your option) any later version.
--
-... | null | https://raw.githubusercontent.com/purebred-mua/purebred/211b7772a292b62ce88fbdf6aeae390ef0abe7cc/src/Purebred/UI/Index/Main.hs | haskell | This file is part of purebred
purebred is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ... | Copyright ( C ) 2018
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU Affero General Public License
module Purebred.UI.Index.Main (
renderListOfThreads
, renderList... |
307ee7d5f41034cac16eb151220c1fe08eb300ef4681d5281059306a58f3de0f | cardmagic/lucash | fdflags.scm | ;;; Flags for open(2) and fcntl(2).
Copyright ( c ) 1993 by . See file COPYING .
Copyright ( c ) 1994 by
(define-enum-constants open
;; POSIX
(read #x0000)
(write #x0001)
(read+write #x0002)
(non-blocking #x0800) ; no delay
(append #x0400) ; set append mode
Linux
(shared-lock #x000... | null | https://raw.githubusercontent.com/cardmagic/lucash/0452d410430d12140c14948f7f583624f819cdad/reference/scsh-0.6.6/scsh/linux/fdflags.scm | scheme | Flags for open(2) and fcntl(2).
POSIX
no delay
set append mode
open with shared file lock
open with exclusive file lock
signal pgrep when data ready
synchronus writes
POSIX
create if nonexistant
error if already exists
don't assign controlling terminal
fcntl() commands
F_DUPFD
F_GETFD
F_SETFD
F_GETFL
... | Copyright ( c ) 1993 by . See file COPYING .
Copyright ( c ) 1994 by
(define-enum-constants open
(read #x0000)
(write #x0001)
(read+write #x0002)
Linux
truncate to zero length
(define open/access-mask
(bitwise-ior open/read
(bitwise-ior open/write open/read+write)))
(define-enu... |
119d16af7b2a2824259215cc2348653b281c3c493ee7bafbe1a7d27234546f87 | alexandergunnarson/quantum | exponents.cljc | (ns quantum.core.numeric.exponents
(:refer-clojure :exclude [+ *])
(:require
[clojure.core :as core]
[quantum.core.error :as err
:refer [TODO]]
[quantum.core.macros
:refer [defnt #?@(:clj [defnt'])]]
[quantum.core.vars
:refer [defalias #?@(:clj [defmalias])]]
[quantum.cor... | null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src/quantum/core/numeric/exponents.cljc | clojure | ===== EXPONENTS ===== ;
===== INVERSE EXPONENTS (ROOTS) ===== ;
arbitrary to choose ln vs. log-10
pow'
private double pow'(double d, int exp) {
double r = d;
i < exp ; i++ ) {
r *= d;
}
return r;
}
truncation is acceptable | (ns quantum.core.numeric.exponents
(:refer-clojure :exclude [+ *])
(:require
[clojure.core :as core]
[quantum.core.error :as err
:refer [TODO]]
[quantum.core.macros
:refer [defnt #?@(:clj [defnt'])]]
[quantum.core.vars
:refer [defalias #?@(:clj [defmalias])]]
[quantum.cor... |
cbbe2286b4c42b52cb864c7b1b2fffccc41de21d930ec36da47bb5d19b508d17 | haskell-mafia/mismi | Mismi.hs | module Mismi (
module X
) where
import Mismi.Control as X
import Mismi.Data as X
import Mismi.Environment as X
| null | https://raw.githubusercontent.com/haskell-mafia/mismi/f6df07a52c6c8b1cf195b58d20ef109e390be014/mismi-core/src/Mismi.hs | haskell | module Mismi (
module X
) where
import Mismi.Control as X
import Mismi.Data as X
import Mismi.Environment as X
| |
e057962421f3d0e31ee836ce117b21da97aef9a62bd908b748776a3fcf596a7a | kushidesign/kushi | core.cljs | (ns kushi.ui.title.core
(:require [kushi.core :refer (merge-attrs) :refer-macros [sx]]
[kushi.ui.core :refer (opts+children)]
[kushi.ui.label.core :refer (label)]))
(defn title
{:desc ["Title is a kind of label, typically used for providing titles to sections of content."]}
[& args]
(le... | null | https://raw.githubusercontent.com/kushidesign/kushi/5f0b220beaa67624821a5f2bd174e5649b0ffdc3/src/kushi/ui/title/core.cljs | clojure | (ns kushi.ui.title.core
(:require [kushi.core :refer (merge-attrs) :refer-macros [sx]]
[kushi.ui.core :refer (opts+children)]
[kushi.ui.label.core :refer (label)]))
(defn title
{:desc ["Title is a kind of label, typically used for providing titles to sections of content."]}
[& args]
(le... | |
65f9da356d6505c6ad13addc34e437af9caf3e8b0205def2b997604eb48d1782 | Drup/LILiS | lisCommon.ml | (** Various stuff for all other modules. *)
* The AST for a Lsystem .
module AST = struct
type arit = string Calc.t
type 'a token = string * 'a list
type axiom = arit token list
type expr = arit token list
type def = ((string * arit option) token) list * expr
type rule = {
lhs : string ;
vars... | null | https://raw.githubusercontent.com/Drup/LILiS/df63fbc3ee77b3378ae1ef27715828c3ad892475/lilis/lisCommon.ml | ocaml | * Various stuff for all other modules. |
* The AST for a Lsystem .
module AST = struct
type arit = string Calc.t
type 'a token = string * 'a list
type axiom = arit token list
type expr = arit token list
type def = ((string * arit option) token) list * expr
type rule = {
lhs : string ;
vars : string list ;
rhs : (string * (arit l... |
91e63fa3acf40860f027e5fc7431d967e0f4e5269fd21011d7280509ea613981 | yi-editor/yi | BufferExCommand.hs | {-# LANGUAGE OverloadedStrings #-}
-- | Tests for the :buffer ex command in the Vim keymap
--
module Vim.EditorManipulations.BufferExCommand (tests) where
import qualified Data.List.NonEmpty as NE
import Generic.TestUtils
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit
imp... | null | https://raw.githubusercontent.com/yi-editor/yi/58c239e3a77cef8f4f77e94677bd6a295f585f5f/yi-keymap-vim/tests/Vim/EditorManipulations/BufferExCommand.hs | haskell | # LANGUAGE OverloadedStrings #
| Tests for the :buffer ex command in the Vim keymap
each.
return () | module Vim.EditorManipulations.BufferExCommand (tests) where
import qualified Data.List.NonEmpty as NE
import Generic.TestUtils
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit
import Yi.Buffer
import Yi.Config (Config)
import Yi.Editor
import ... |
284ac4ce5c9ee1cce8a85447be99bf80fb9d28909f86c3c45fcfddf93f0189ef | talex5/ocaml-wayland | schema.ml | let bool_of_string = function
| "true" -> true
| "false" -> false
| x -> Fmt.failwith {|Expected "true" or "false", but got %S|} x
let int_of_string x v =
match int_of_string_opt v with
| Some i -> i
| None -> Fmt.failwith "Not an integer %S at %a" v Xml.pp x
let int32_of_string x v =
match Int32.of_str... | null | https://raw.githubusercontent.com/talex5/ocaml-wayland/1f46a3b3d13260c674c3846f42ee8e636cd86516/scanner/schema.ml | ocaml | let bool_of_string = function
| "true" -> true
| "false" -> false
| x -> Fmt.failwith {|Expected "true" or "false", but got %S|} x
let int_of_string x v =
match int_of_string_opt v with
| Some i -> i
| None -> Fmt.failwith "Not an integer %S at %a" v Xml.pp x
let int32_of_string x v =
match Int32.of_str... | |
ed53136ba6af96deb9a987b5bd3238043176c022dca8d9d88baef1ffd023eb8b | jyh/metaprl | fol_true.ml | (*
* "True" constant.
*)
extends Fol_type
open Basic_tactics
declare "true"
declare "it"
dform true_df : "true" = `"True"
prim true_type {| intro [] |} :
sequent { <H> >- "type"{."true"} } = trivial
prim true_intro {| intro [] |} :
sequent { <H> >- "true" } = it
(*
* -*-
* Local Variables:
* Caml-mast... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/fol/fol_true.ml | ocaml |
* "True" constant.
* -*-
* Local Variables:
* Caml-master: "pousse"
* End:
* -*-
|
extends Fol_type
open Basic_tactics
declare "true"
declare "it"
dform true_df : "true" = `"True"
prim true_type {| intro [] |} :
sequent { <H> >- "type"{."true"} } = trivial
prim true_intro {| intro [] |} :
sequent { <H> >- "true" } = it
|
93e831ae47cdc913dc40d9e3a3629c091ab861c43f61d43fda3cde066c3cef6e | janestreet/memtrace_viewer_with_deps | runtime.mli | open Base
(** Types used in the generated code *)
type 'a test_pred
= ?here:Lexing.position list
-> ?message:string
-> ('a -> bool)
-> 'a
-> unit
type 'a test_eq
= ?here:Lexing.position list
-> ?message:string
-> ?equal:('a -> 'a -> bool)
-> 'a
-> 'a
-> unit
type 'a test_result
= ?here:Lexi... | null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/vendor/ppx_assert/runtime-lib/runtime.mli | ocaml | * Types used in the generated code
* Functions called by the generated code | open Base
type 'a test_pred
= ?here:Lexing.position list
-> ?message:string
-> ('a -> bool)
-> 'a
-> unit
type 'a test_eq
= ?here:Lexing.position list
-> ?message:string
-> ?equal:('a -> 'a -> bool)
-> 'a
-> 'a
-> unit
type 'a test_result
= ?here:Lexing.position list
-> ?message:string
... |
348e4c0f02acdd16e65ca12a8ab2b73860a0251342eac5cbe70cb35e2bc1e4fc | beamparticle/beamparticle | beamparticle_ide_alive_handler.erl | %%%-------------------------------------------------------------------
%%% @doc
%%% Alive for IDE.
%%% @end
%%%
%%% %CopyrightBegin%
%%%
Copyright < > 2017 .
All Rights Reserved .
%%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file except in compliance with t... | null | https://raw.githubusercontent.com/beamparticle/beamparticle/65dcea1569d06b331b08cd9f8018ece4b176b690/handlers/beamparticle_ide_alive_handler.erl | erlang | -------------------------------------------------------------------
@doc
Alive for IDE.
@end
%CopyrightBegin%
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 WARRAN... | Copyright < > 2017 .
All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(beamparticle_ide_alive_handler).
-include("beamparticle_constants.hrl").
-export([init/2]).
init(Req0, Opts) ->
... |
67e5778fda31e3c914ad6fd07ad90de3b88d35f59899d4ff7a7b4a01270558a0 | emina/rosette | solution.rkt | #lang racket
(require "../base/core/term.rkt")
(provide solution? sat? unsat? unknown?
(rename-out [make-sat sat] [make-unsat unsat] [make-unknown unknown])
model core complete-solution)
; Represents the solution to a set of logical constraints.
; The contents of a solution depend on whether it is ... | null | https://raw.githubusercontent.com/emina/rosette/a64e2bccfe5876c5daaf4a17c5a28a49e2fbd501/rosette/solver/solution.rkt | racket | Represents the solution to a set of logical constraints.
The contents of a solution depend on whether it is satisfiable,
unsatisfiable, or unknown.
A satisfiable solution consists of a dictionary that binds symbolic
constants to values. Such a solution can be used as a procedure, which takes as input
a symbolic ... | #lang racket
(require "../base/core/term.rkt")
(provide solution? sat? unsat? unknown?
(rename-out [make-sat sat] [make-unsat unsat] [make-unknown unknown])
model core complete-solution)
(struct solution ())
(struct sat solution (model)
#:property prop:procedure
(lambda (self arg)
(let ([... |
b4f115a48936061e54716478957be64acca17f44e7387843799f5813c82675a2 | bmeurer/ocaml-arm | equations.mli | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bmeurer/ocaml-arm/43f7689c76a349febe3d06ae7a4fc1d52984fd8b/testsuite/tests/misc-kb/equations.mli | ocaml | *********************************************************************
OCaml
... | , 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 .
$ Id$
open Terms
type rule =
{ nu... |
2d0562c050e8bc9e3a40b7a3954148d184c1d074dac6ed341a37e7c7ab10b6b8 | janestreet/memtrace_viewer_with_deps | vdom_input_widgets_intf.ml | open Core_kernel
module type Display = sig
type t
val to_string : t -> string
end
module type Equal = sig
type t [@@deriving equal]
include Display with type t := t
end
module type Enum = sig
type t [@@deriving equal, enumerate]
include Display with type t := t
end
module type Set = sig
type t
ty... | null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/vendor/virtual_dom/input_widgets/src/vdom_input_widgets_intf.ml | ocaml | open Core_kernel
module type Display = sig
type t
val to_string : t -> string
end
module type Equal = sig
type t [@@deriving equal]
include Display with type t := t
end
module type Enum = sig
type t [@@deriving equal, enumerate]
include Display with type t := t
end
module type Set = sig
type t
ty... | |
cf7e07e3d12c854ba0081d2d50aa1956820bc6237877e0372e97bad59eccddb4 | replikativ/datalog-parser | util.cljc | (ns datalog.parser.util
(:require [datalog.parser.impl.proto :as proto]))
#?(:clj (set! *warn-on-reflection* true))
(defn postwalk [form f]
;; additional handling for maps and records that keeps structure type
(cond
(proto/-traversable? form) (f (proto/-postwalk form f))
(map? form) (f (reduce-k... | null | https://raw.githubusercontent.com/replikativ/datalog-parser/597b6a04fb9d1f5931a40566058620e422a77532/src/datalog/parser/util.cljc | clojure | additional handling for maps and records that keeps structure type
rest comes from clojure.core | (ns datalog.parser.util
(:require [datalog.parser.impl.proto :as proto]))
#?(:clj (set! *warn-on-reflection* true))
(defn postwalk [form f]
(cond
(proto/-traversable? form) (f (proto/-postwalk form f))
(map? form) (f (reduce-kv
(fn map-walker [form k v]
... |
797ab4073f23fadeaea4d166a528e90257508228b39fbc83668f734ef2ffcdcb | jaked/orpc | check.ml |
* This file is part of orpc , OCaml signature to ONC RPC generator
* Copyright ( C ) 2008 - 9 Skydeck , Inc
* Copyright ( C ) 2010
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software F... | null | https://raw.githubusercontent.com/jaked/orpc/ecb5df8ec928070cd89cf035167fcedf3623ee3c/src/generator/check.ml | ocaml | XXX check for circular type definitions. accept -rectypes?
XXX check for reserved words in type and value names and argument labels?
XXX check variant tags are not reused
to marshal we need to know all the arms
we don't have type info, can't check. XXX maybe should just leave checking to compiler?
XXX is... |
* This file is part of orpc , OCaml signature to ONC RPC generator
* Copyright ( C ) 2008 - 9 Skydeck , Inc
* Copyright ( C ) 2010
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software F... |
98b867b2101595a0bbfefd5c0ee9d84470e34dad472e91cc479d40d305ed632f | crategus/cl-cffi-gtk | tool-palette.lisp | Example Tool Palette ( 2021 - 3 - 15 )
;;;;
;;;; A tool palette widget shows groups of toolbar items as a grid of icons or
;;;; a list of names.
(in-package :gtk-example)
(defun load-icon-items (palette)
(let* ((max-icons 24) ; Do not load too much icons.
(icon-theme (gtk-icon-theme-for-screen (gtk-widge... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/74a78a6912a96f982644f3ee5ab7b8396cc2235f/demo/gtk-example/tool-palette.lisp | lisp |
A tool palette widget shows groups of toolbar items as a grid of icons or
a list of names.
Do not load too much icons.
Palette DnD
This need to be fixed more general.
(gtk-container-child-set drop-group
drag-item
"homogenous" (p... | Example Tool Palette ( 2021 - 3 - 15 )
(in-package :gtk-example)
(defun load-icon-items (palette)
(icon-theme (gtk-icon-theme-for-screen (gtk-widget-screen palette)))
(contexts (gtk-icon-theme-list-contexts icon-theme)))
(dolist (context contexts)
(let ((group (gtk-tool-item-group-new co... |
823b93d091eb25d3d6291b927f832c816fe656674a9e1035e1fd30b0c3a55ef4 | liebke/avout | locks.clj | (ns avout.dynamodb.locks
(:use avout.core
avout.locks
avout.dynamodb.atom)
(:import (java.util.concurrent.locks Lock)
(java.util UUID)))
(deftype DynamoDBLock [client table-name name locked flag]
Lock
(lock [this]
(throw (UnsupportedOperationException.)))
(tryLock [this]
... | null | https://raw.githubusercontent.com/liebke/avout/06f3e00d63f487ebd01581343302e96b915f5b03/experimental/orolo/plugins/avout-ddb/src/avout/dynamodb/locks.clj | clojure | LEASED LOCK | (ns avout.dynamodb.locks
(:use avout.core
avout.locks
avout.dynamodb.atom)
(:import (java.util.concurrent.locks Lock)
(java.util UUID)))
(deftype DynamoDBLock [client table-name name locked flag]
Lock
(lock [this]
(throw (UnsupportedOperationException.)))
(tryLock [this]
... |
712c9cb5afac519e9cc2a862c2fb1f48bc8d1115a6f52276c090c1cf3801cccd | realworldocaml/book | build_context.ml | open Import
type t =
{ name : Context_name.t
; build_dir : Path.Build.t
; host : Context_name.t option
}
let create ~name ~host =
let build_dir = Path.Build.of_string (Context_name.to_string name) in
{ name; build_dir; host }
| null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/dune_/src/dune_engine/build_context.ml | ocaml | open Import
type t =
{ name : Context_name.t
; build_dir : Path.Build.t
; host : Context_name.t option
}
let create ~name ~host =
let build_dir = Path.Build.of_string (Context_name.to_string name) in
{ name; build_dir; host }
| |
a6385f603c053368c03af9c0069715577df21b17ab65b8372fa7050bbe249d37 | AdRoll/rebar3_format | brackets.erl | -module(brackets).
-format(#{paper => 50, inline_items => all}).
-compile(export_all).
many_arguments(One, Two, Three, Four, Five, Six, Seven) ->
{in, a, tuple, One, Two, Three, Four, Five, Six, Seven}.
one_big_argument(A_Really_Really_Very_Long_Argument_Name) ->
[A_Really_Really_Very_Long_Argument_Name, in... | null | https://raw.githubusercontent.com/AdRoll/rebar3_format/5ffb11341796173317ae094d4e165b85fad6aa19/test_app/src/brackets.erl | erlang | with
should not loose them
if they are really very long and go beyond the paper limit
it should not
if the comments are
in tuples within lists within tuples or | -module(brackets).
-format(#{paper => 50, inline_items => all}).
-compile(export_all).
many_arguments(One, Two, Three, Four, Five, Six, Seven) ->
{in, a, tuple, One, Two, Three, Four, Five, Six, Seven}.
one_big_argument(A_Really_Really_Very_Long_Argument_Name) ->
[A_Really_Really_Very_Long_Argument_Name, in... |
851c096662425ecfd4c0bc7f68c4c078c97f968a4d90119686974098b39c283f | darkleaf/publicator | core.clj | (ns publicator.main.core
(:require
[com.stuartsierra.component :as component]
[signal.handler :as signal]
[publicator.web.components.jetty :as jetty]
[publicator.web.components.handler :as handler]
[publicator.persistence.components.data-source :as data-source]
[publicator.persistence.components.mig... | null | https://raw.githubusercontent.com/darkleaf/publicator/e07eee93d8f3d9c07a15d574619d5ea59c00f87d/main/src/publicator/main/core.clj | clojure | (ns publicator.main.core
(:require
[com.stuartsierra.component :as component]
[signal.handler :as signal]
[publicator.web.components.jetty :as jetty]
[publicator.web.components.handler :as handler]
[publicator.persistence.components.data-source :as data-source]
[publicator.persistence.components.mig... | |
9751047947ed00d1459df79e392f3d5bbdd30274e6997ccb103d94a693759441 | chansey97/clprosette-miniKanren | smt-extra-tests.rkt | #lang racket
(require "../mk.rkt")
(require "../rosette-bridge.rkt")
(require "../test-check.rkt")
(printf "smt-extra-tests.rkt\n")
(test "conde"
(run 3 (q)
(rosette-typeo q r/@integer?)
(conde
((rosette-asserto `(,r/@= ,q 1)))
((rosette-asserto `(,r/@= ,q 2)))))
'(1 2))
(test "join"
(run 2 ... | null | https://raw.githubusercontent.com/chansey97/clprosette-miniKanren/d322f688312fa9481b22c2729018d383f493cb82/clprosette-miniKanren/tests/smt-extra-tests.rkt | racket | equivalent | #lang racket
(require "../mk.rkt")
(require "../rosette-bridge.rkt")
(require "../test-check.rkt")
(printf "smt-extra-tests.rkt\n")
(test "conde"
(run 3 (q)
(rosette-typeo q r/@integer?)
(conde
((rosette-asserto `(,r/@= ,q 1)))
((rosette-asserto `(,r/@= ,q 2)))))
'(1 2))
(test "join"
(run 2 ... |
3ea5b5c84edf4f1db8854569673d2b882b5ecd0dae4c1814fd3c45d6776bbdaf | phadej/trustee | Estimation.hs | module Urakka.Estimation (
Estimator,
mkEstimator,
currentEstimate,
addEstimationPoint,
MonadSTM (..),
) where
import Prelude
import Control.Concurrent.STM
(STM, newTVar, TVar, atomically, modifyTVar', readTVar, writeTVar)
import System.Clock (TimeSpec, Clock (Monotonic), ge... | null | https://raw.githubusercontent.com/phadej/trustee/ab714484b39b43795ff586d5f232fad911a05dfd/src/Urakka/Estimation.hs | haskell | -----------------------------------------------------------------------------
MonadSTM
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Estimator
-----------------------------------------------------------------... | module Urakka.Estimation (
Estimator,
mkEstimator,
currentEstimate,
addEstimationPoint,
MonadSTM (..),
) where
import Prelude
import Control.Concurrent.STM
(STM, newTVar, TVar, atomically, modifyTVar', readTVar, writeTVar)
import System.Clock (TimeSpec, Clock (Monotonic), ge... |
962fc2b4d5f82f8f5cda5cd20fef286a239f7d8ec3883b0b8a72d11807adf4e3 | jqueiroz/lojban.io | Exercises2.hs | {-# LANGUAGE OverloadedStrings #-}
module Lessons.Exercises where
import Core
import Util (chooseItem, chooseItemUniformly, chooseItemsUniformly, combineGenerators, combineGeneratorsUniformly)
import System.Random (StdGen)
import qualified Data.Text as T
import qualified Data.Map as M
Exercise : recall gismu meanin... | null | https://raw.githubusercontent.com/jqueiroz/lojban.io/68c3e919f92ea1294f32ee7772662ab5667ecef6/misc/archive/haskell/Exercises2.hs | haskell | # LANGUAGE OverloadedStrings #
[x1, x2, x3]
[x1, x2, x3, x4]
[x1, x2, x3, x4, x5]
, [x1, x2, x4, x3, x5]
TODO: randomize
Other exercises...
Exercise: given a portion of a sentence, choose its syntactical function | module Lessons.Exercises where
import Core
import Util (chooseItem, chooseItemUniformly, chooseItemsUniformly, combineGenerators, combineGeneratorsUniformly)
import System.Random (StdGen)
import qualified Data.Text as T
import qualified Data.Map as M
Exercise : recall gismu meaning
generateGismuMeaningExercise :: [... |
5796adb28e0b274268f6c91d3aacf370f91118a03232c77dd896486059fb0e6a | basho/enm | enm_app.erl | %% -------------------------------------------------------------------
%%
enm_app : Erlang driver - based binding for nanomsg
%%
Copyright ( c ) 2014 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this fi... | null | https://raw.githubusercontent.com/basho/enm/0c8a047ebda77e35fc9c514585e7a523a3fc8cfa/src/enm_app.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissi... | enm_app : Erlang driver - based binding for nanomsg
Copyright ( c ) 2014 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BA... |
d4890fcd7d97ea56590e74a1480915bc7abee74f31735753211d657ecaab0673 | erlang/otp | ftp_test_lib.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2001 - 2022 . All Rights Reserved .
%%
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 applicab... | null | https://raw.githubusercontent.com/erlang/otp/eccc556e79f315d1f87c10fb46f2c4af50a63f20/lib/ftp/test/ftp_test_lib.erl | erlang |
%CopyrightBegin%
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 lan... | Copyright Ericsson AB 2001 - 2022 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(ftp_test_lib).
-include_lib("public_key/include/public_key.hrl").
-export([make_cert_files/1]).
make_cert... |
e9ee120222c3c67d2ee9558577e574993a1bd7327ae635d14eec9b4e9dda4ccc | 2600hz-archive/whistle | rabbit_exchange_type_fanout.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/lib/rabbitmq_server-2.4.1/src/rabbit_exchange_type_fanout.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
| The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is VMware , Inc.
Copyright ( c ) 2007 - 2011 VMware , Inc. All rights reserved .
-module(rabbi... |
206f02c58fb735a7a84464b0a5bcd4745d571772b092187facdef365316d9c42 | futurice/haskell-mega-repo | Ctx.hs | module Futurice.App.Badge.Ctx where
import Data.Void (Void)
import Futurice.Prelude
import Prelude ()
import qualified Codec.Archive.Tar as Tar
import Futurice.App.Badge.Config
data Ctx = Ctx
{ ctxConfig :: Config
, ctxLogger :: Logger
, ctxManager :: Manager
, ctxTar :: Tar.Entries Voi... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/badge-app/src/Futurice/App/Badge/Ctx.hs | haskell | module Futurice.App.Badge.Ctx where
import Data.Void (Void)
import Futurice.Prelude
import Prelude ()
import qualified Codec.Archive.Tar as Tar
import Futurice.App.Badge.Config
data Ctx = Ctx
{ ctxConfig :: Config
, ctxLogger :: Logger
, ctxManager :: Manager
, ctxTar :: Tar.Entries Voi... | |
b3de491fe5538f76777a0a78c22004d2b0b6e40c95d165ac50af5d405b17c8c3 | ucsd-progsys/liquidhaskell | MonadId.hs | {-@ LIQUID "--reflection" @-}
module MonadId where
import Prelude hiding (return, (>>=))
import Language.Haskell.Liquid.ProofCombinators
import Helper
-- | Monad Laws :
-- | Left identity: return a >>= f ≡ f a
-- | Right identity: m >>= return ≡ m
| Associativity : ( m > > = f ) > > = g ≡ m > > = ( ... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/20cd67af038930cb592d68d272c8eb1cbe3cb6bf/tests/benchmarks/popl18/nople/pos/MonadId.hs | haskell | @ LIQUID "--reflection" @
| Monad Laws :
| Left identity: return a >>= f ≡ f a
| Right identity: m >>= return ≡ m
@ reflect return @
@ reflect bind @
| Left Identity
@ left_identity :: x:a -> f:(a -> Identity b) -> { bind (return x) f == f x } @
| Right Identity
@ right_identity :: x:Identity a -> { bind x r... |
module MonadId where
import Prelude hiding (return, (>>=))
import Language.Haskell.Liquid.ProofCombinators
import Helper
| Associativity : ( m > > = f ) > > = g ≡ m > > = ( \x - > f x > > = g )
return :: a -> Identity a
return x = Identity x
bind :: Identity a -> (a -> Identity b) -> Identity b
bind (Id... |
341ed0d316c8ca9b7415e4f93ad0026dfec933726a54a11a74fff7bf8f0749b6 | amosr/folderol | Name.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE LambdaCase #
module Folderol.Untyped.Name where
import P
import qualified Language.Haskell.TH as Haskell
import qualified Text.PrettyPrint.Annotated.WL as Pretty
newtype Channel = Channel { unChannel :: Haskell.Name }
deriving (Eq, Ord, ... | null | https://raw.githubusercontent.com/amosr/folderol/9b8c0cd30cfb798dadaa404cc66404765b1fc4fe/src/Folderol/Untyped/Name.hs | haskell | # LANGUAGE OverloadedStrings #
instance Pretty.Pretty Exp where
pretty = Pretty.text . show . unExp
| # LANGUAGE NoImplicitPrelude #
# LANGUAGE LambdaCase #
module Folderol.Untyped.Name where
import P
import qualified Language.Haskell.TH as Haskell
import qualified Text.PrettyPrint.Annotated.WL as Pretty
newtype Channel = Channel { unChannel :: Haskell.Name }
deriving (Eq, Ord, Show)
newtype Label = Label { unLa... |
948b45b6ee4dc818ded3eaadf9fdee5debfb525a56cfdd8f05ea69f6da95bab6 | picnic/RelationExtraction | proofgen.ml | (****************************************************************************)
RelationExtraction - Extraction of inductive relations for Coq
(* *)
(* This program is free software: you can redistribute it and/or modify *)
it u... | null | https://raw.githubusercontent.com/picnic/RelationExtraction/a4cee37d0a8e5f0eff2e010e6305e037aa0d2564/proofgen.ml | ocaml | **************************************************************************
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
... | RelationExtraction - Extraction of inductive relations for Coq
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
Copyright 2... |
29711383b030393c8881b760394676b9870f691d544ce8e0558b9f0cbefcab05 | league/yesod-crud | Application.hs | # OPTIONS_GHC -fno - warn - orphans #
module Application
( getApplicationDev
, appMain
, develMain
, makeFoundation
, makeLogWare
-- * for DevelMain
, getApplicationRepl
, shutdownApp
-- * for GHCI
, handler
, db
) where
import Control.Monad.Logger (liftL... | null | https://raw.githubusercontent.com/league/yesod-crud/6cf3a1871dd6471e9423348c38aff6920d5b4bce/example/Application.hs | haskell | * for DevelMain
* for GHCI
Import all relevant handler modules here.
Don't forget to add new modules to your cabal file!
comments there for more details.
| This function allocates resources (such as a database connection pool),
performs initialization and return a foundation datatype value. This is also
the pla... | # OPTIONS_GHC -fno - warn - orphans #
module Application
( getApplicationDev
, appMain
, develMain
, makeFoundation
, makeLogWare
, getApplicationRepl
, shutdownApp
, handler
, db
) where
import Control.Monad.Logger (liftLoc, runLoggingT)
import Database.Persist.... |
659309ad4169634b625928a62df9e5fe01e5b7753c578b4a035a6799bfd696b1 | amosr/folderol | Quickhull.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE ScopedTypeVariables #
module Bench.Clustering.Quickhull where
import Bench.Plumbing.Folderol
import Bench.Quickhull.Skeleton
import Folderol
import Folderol.Splice
import qualified Folderol.Source as Source
import qualified Data.Vector.Unboxed as... | null | https://raw.githubusercontent.com/amosr/folderol/9b8c0cd30cfb798dadaa404cc66404765b1fc4fe/bench/Bench/Clustering/Quickhull.hs | haskell | # LANGUAGE BangPatterns #
# INLINE pivots'2 # | # LANGUAGE TemplateHaskell #
# LANGUAGE ScopedTypeVariables #
module Bench.Clustering.Quickhull where
import Bench.Plumbing.Folderol
import Bench.Quickhull.Skeleton
import Folderol
import Folderol.Splice
import qualified Folderol.Source as Source
import qualified Data.Vector.Unboxed as Unbox
import Prelude hiding ... |
6d9249f57e273568d6b73f57321ab4b3f0d4b5ea467de815fd23b51e4c3491be | seckcoder/iu_c311 | ds.rkt | #lang eopl
(require "grammar.rkt")
(require "store.rkt")
(require "../base/queue.rkt")
(require "../base/utils.rkt")
(provide (all-defined-out))
; expval := Int | Bool | Proc
; during the implemention, I find this datatype actually
; useless...
(define-datatype
expval expval?
(numval
(int integer?))
(boolval... | null | https://raw.githubusercontent.com/seckcoder/iu_c311/a1215983b6ab08df32058ef1e089cb294419e567/racket/thread1/ds.rkt | racket | expval := Int | Bool | Proc
during the implemention, I find this datatype actually
useless...
environment
env := '() | (var val env) | #lang eopl
(require "grammar.rkt")
(require "store.rkt")
(require "../base/queue.rkt")
(require "../base/utils.rkt")
(provide (all-defined-out))
(define-datatype
expval expval?
(numval
(int integer?))
(boolval
(bool boolean?))
(listval
(list list?))
(procval
(proc proc?))
(threadval
(th... |
3351a7b83e7aceb32f34a3c6f47fbc7685b875990fecb2c04f6b7d949f4441cd | alesaccoia/festival_flinger | f2bf0lr.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;
Centre for Speech Technology Research ; ;
University of Edinburgh , UK ; ;
;;; ... | null | https://raw.githubusercontent.com/alesaccoia/festival_flinger/87345aad3a3230751a8ff479f74ba1676217accd/lib/f2bf0lr.scm | scheme |
;;
;
;
Copyright (c) 1996,1997 ;;
;
;;
Permission is hereby granted, free of charge, to use and distribute ;;
this softwar... | First attempt at a linear regression model to predict F0 values .
This is an attempt to reimplement the work in Black and
ICSLP96 , though this model probably is n't as good .
R2 = 0.251 , F(74 , ) = 57.5 , Prob > F = 0.000
RMSE = 27.877
R2 = 0.332 , F(74 , ) = 85.6 , Prob > F = 0.000
RMSE = 28.... |
06c33e21b36d0b93d84b902edd8ead931225a3d7cf61f3a4264164100d27462c | oakes/dynadoc-examples | project.clj | (defproject basic-lein-cljs "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/clojurescript "1.10.439"]
[reagent "0.8.1"]
necessary for Java 9 compatibility
[dynadoc "RELEASE"]]
:jvm-opts ^:replace ["-Xmx1g" "-server"]
:plugins [[lein-... | null | https://raw.githubusercontent.com/oakes/dynadoc-examples/b23ef1003365d238847d1f1ea3f6d73149ae0bac/basic-lein-cljs/project.clj | clojure | (defproject basic-lein-cljs "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/clojurescript "1.10.439"]
[reagent "0.8.1"]
necessary for Java 9 compatibility
[dynadoc "RELEASE"]]
:jvm-opts ^:replace ["-Xmx1g" "-server"]
:plugins [[lein-... | |
e2da000e88f1547efe075013c38ac85dd7381025bd9d0b1f89a4f027d460ff2c | fumieval/extensible | bits.hs | # LANGUAGE DataKinds , PolyKinds , TypeOperators , TypeFamilies , FlexibleContexts #
{-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
# LANGUAGE TemplateHaskell #
import Control.Lens
import Data.Bits
import Data.Extensible
import Data.Extensible.Bits
import Data.Int
import Data.Proxy
import Data.Word
import GHC.TypeLi... | null | https://raw.githubusercontent.com/fumieval/extensible/6b119e922c1c109c2812d4ad3a2153838528c39d/tests/bits.hs | haskell | # LANGUAGE Rank2Types, ScopedTypeVariables # | # LANGUAGE DataKinds , PolyKinds , TypeOperators , TypeFamilies , FlexibleContexts #
# LANGUAGE TemplateHaskell #
import Control.Lens
import Data.Bits
import Data.Extensible
import Data.Extensible.Bits
import Data.Int
import Data.Proxy
import Data.Word
import GHC.TypeLits
import Language.Haskell.TH (mkName)
import Tes... |
d07bc3271cb663b0355d51a874969cb07588c9400b6be013d024942c51a65fae | astrada/ppx_bs_css | ppx_css.ml | open Migrate_parsetree
open Ast_410
open Ast_mapper
open Asttypes
open Parsetree
let expr mapper e =
match e.pexp_desc with
| Pexp_extension
({ txt; loc; _ },
PStr [{ pstr_desc = Pstr_eval (e, _); _ }]) when txt = "style" ||
txt = "css" ->
be... | null | https://raw.githubusercontent.com/astrada/ppx_bs_css/abfa22f932129e40af1a5e4db353ac4a6e1deaee/src/ppx_css.ml | ocaml | open Migrate_parsetree
open Ast_410
open Ast_mapper
open Asttypes
open Parsetree
let expr mapper e =
match e.pexp_desc with
| Pexp_extension
({ txt; loc; _ },
PStr [{ pstr_desc = Pstr_eval (e, _); _ }]) when txt = "style" ||
txt = "css" ->
be... | |
027a5509fb493c8834d83b30d84d43ef8c2926e6b5a69e35b22f2d1737e60c6d | richmit/mjrcalc | exp-ODErossler.lisp | ;; -*- Mode:Lisp; Syntax:ANSI-Common-LISP; Coding:us-ascii-unix; fill-column:158 -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;; @file exp-ODErossler.lisp
@author < >
;; @brief C... | null | https://raw.githubusercontent.com/richmit/mjrcalc/96f66d030034754e7d3421688ff201f4f1db4833/exp-ODErossler.lisp | lisp | -*- Mode:Lisp; Syntax:ANSI-Common-LISP; Coding:us-ascii-unix; fill-column:158 -*-
@file exp-ODErossler.lisp
@brief Compute the Rossler strange attracter.@EOL
@std Common Lisp
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the followin... | @author < >
@parblock
Copyright ( c ) 1997,1998,2004,2012,2015 , < > All rights reserved .
1 . Redistributions of source code must retain the above copyright notice , this list of conditions , and the following disclaimer .
2 . Redistributions in binary form must reproduce the above copyrigh... |
6fa8697440eb0371b0212133403bab2c28de1c2271739889246e0188ab62d06c | KeliLanguage/compiler | PreludeJSCode.hs | # LANGUAGE QuasiQuotes #
module PreludeJSCode where
import Text.RawString.QQ
-- The following code is copied from '../kelilib/prelude.js'
preludeJSCode :: String
preludeJSCode = [r|
"use strict";
// For displaying a particular data
function KELI$show(o) {
// if o is an array
if (Array.isA... | null | https://raw.githubusercontent.com/KeliLanguage/compiler/5cc5f2314fa0e0863a49c504cdb115d799f382f6/src/PreludeJSCode.hs | haskell | The following code is copied from '../kelilib/prelude.js'
!== 0;)
!== 0;)
!== 0;) { | # LANGUAGE QuasiQuotes #
module PreludeJSCode where
import Text.RawString.QQ
preludeJSCode :: String
preludeJSCode = [r|
"use strict";
// For displaying a particular data
function KELI$show(o) {
// if o is an array
if (Array.isArray(o)) {
return "[" + o.map(KELI$show) + "]"
... |
8211c7615d0e04f80a0f089a6fe7e819f4b9ec99d9a4e4afb8ef6ffb893a894e | antyakushev/haskell-exercises | evenOnly.hs | evenOnly :: [a] -> [a]
evenOnly = (\(fst,_,_) -> fst) . foldr (f) ([],[],True) where
f a ~(xs,ys,True) = (a:xs,ys,False)
f a ~(xs,ys,_) = (xs,a:ys,True)
| null | https://raw.githubusercontent.com/antyakushev/haskell-exercises/03c031a0a4c5b8fe8738c1399181aaaa31666a6b/stepic/evenOnly.hs | haskell | evenOnly :: [a] -> [a]
evenOnly = (\(fst,_,_) -> fst) . foldr (f) ([],[],True) where
f a ~(xs,ys,True) = (a:xs,ys,False)
f a ~(xs,ys,_) = (xs,a:ys,True)
| |
a6265b5d030df4028c73ad62fe8de13fa1f28455571baeec0d010d413a6f039c | mattmundell/nightshade | mipsstrops.lisp | ;;; -*- Package: Lisp -*-
;;;
;;; String hacking functions that are stubs for things that might be
;;; microcoded someday.
(in-package "SYSTEM")
(export '(%sp-reverse-find-character-with-attribute))
(in-package "LISP")
;(defun %sp-byte-blt (src-string src-start dst-string dst-start dst-end)
" Moves bytes from Src... | null | https://raw.githubusercontent.com/mattmundell/nightshade/7a67f9eac96414355de1463ec251b98237cb4009/src/code/mipsstrops.lisp | lisp | -*- Package: Lisp -*-
String hacking functions that are stubs for things that might be
microcoded someday.
(defun %sp-byte-blt (src-string src-start dst-string dst-start dst-end)
are also acceptable."
(%primitive byte-blt src-string src-start dst-string dst-start dst-end)) |
(in-package "SYSTEM")
(export '(%sp-reverse-find-character-with-attribute))
(in-package "LISP")
" Moves bytes from Src - String into Dst - String between Dst - Start ( inclusive )
and Dst - End ( exclusive ) ( Dst - Start - Dst - End bytes are moved ) . Overlap of the
strings does not affect the result . This... |
2ed42e68fbabd0815bbd51bcbd180528beb20c2929802e07c3b4ffe5965158b4 | tonymorris/fp-course | JsonParser.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RebindableSyntax #
module Course.JsonParser where
import Course.Core
import Course.Parser
import Course.MoreParser
import Course.JsonValue
import Course.Functor
import Course.Applicative
import Course.Monad
i... | null | https://raw.githubusercontent.com/tonymorris/fp-course/73a64c3d4d0df58654a1a9a0ee9d9b11c3818911/src/Course/JsonParser.hs | haskell | # LANGUAGE OverloadedStrings #
$setup
>>> :set -XOverloadedStrings
A special character is one of the following:
* \f Form feed (ascii code 0C)
* \r Carriage return
* \t Tab
* \' Apostrophe or single quote (only valid in single quoted json strings)
NOTE: This is not inverse to @toSpecialCharacter@.
NOTE: Th... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE RebindableSyntax #
module Course.JsonParser where
import Course.Core
import Course.Parser
import Course.MoreParser
import Course.JsonValue
import Course.Functor
import Course.Applicative
import Course.Monad
import Course.List
import Course.Opt... |
e549ff42e7bf46799c310d89b1cec082651eb5611313eb773de8c8988bd8bea2 | rroohhh/guix_system | cgroupv2.scm | (define-module (services cgroupv2)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix records)
#:use-module (gnu services)
#:use-module (gnu services base)
#:use-module (gnu services configuration)
#:use-module (gnu services dbus)
#:use-module (gnu services shepherd)
#:use-module... | null | https://raw.githubusercontent.com/rroohhh/guix_system/3ed37fdca8ad782e431b2b7a94caae336d188187/services/cgroupv2.scm | scheme | <package>
<package>
<package>
<package>
boolean
boolean
boolean
file
(define-configuration docker-configuration
(docker
(package docker)
(docker-cli
(package docker-cli)
(containerd
(package containerd)
"containerd package.")
(proxy
(package docker-libnetwork-cmd-proxy)
"The... | (define-module (services cgroupv2)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix records)
#:use-module (gnu services)
#:use-module (gnu services base)
#:use-module (gnu services configuration)
#:use-module (gnu services dbus)
#:use-module (gnu services shepherd)
#:use-module... |
b4f9d4eca1b20aff50417a090832a777392f45d41f0d71f333b4467dfc32cfaa | rescript-lang/rescript-compiler | arg.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/c74eb8de6ed6dd909571da9cc4d0ad16ae2154d2/jscomp/stdlib-406/arg.ml | ocaml | ************************************************************************
OCaml
... | , projet Para , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
type key = string
type doc = string
type usage_msg = string
type anon_fun = (string -> unit)
type spec =
... |
efe594cdbb2ec83ee73a3f1e463ebe9e4f743bc893c255993b92595742a33065 | RefactoringTools/wrangler | wrangler_epp.erl | ` ` The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved via the world wide... | null | https://raw.githubusercontent.com/RefactoringTools/wrangler/1c33ad0e923bb7bcebb6fd75347638def91e50a8/src/wrangler_epp.erl | erlang | compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved via the world wide web at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
... | ` ` The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
The Initial Developer of the Original Code is Ericsson Utvecklings AB .
Portions created by Eri... |
7cec348f090278790a1c21550bfb7d916ae036865fb1bf29a4fc1b3ec4d7fc54 | spurious/sagittarius-scheme-mirror | syntax.scm | -*- mode : scheme ; coding : utf-8 ; -*-
cgen cise .
#!core
(library (sagittarius cgen syntax)
(export)
(import (rnrs)
(sagittarius)
(sagittarius control)
(sagittarius cgen cise)
(sagittarius cgen unit)
(sagittarius cgen literal)
(clos user)
(match)
(srfi :26 cut))
... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/sitelib/sagittarius/cgen/syntax.scm | scheme | coding : utf-8 ; -*-
quote
result | cgen cise .
#!core
(library (sagittarius cgen syntax)
(export)
(import (rnrs)
(sagittarius)
(sagittarius control)
(sagittarius cgen cise)
(sagittarius cgen unit)
(sagittarius cgen literal)
(clos user)
(match)
(srfi :26 cut))
From this library , default return type dep... |
0a7a3ceb6588feb94e6c6470acbc73ec0dc194a673228f4089ed4196fa975e87 | whamtet/Excel-REPL | schedule_udf.clj | (ns excel-repl.schedule-udf)
ok , two strategies
;;for ns we will concatenate a list of namespaces to compile
;;ExportUDFS will invoke a fixed function that compiles them
;;for in-macro-context we shall concatenate a list of fuctions to execute
;;INVOKEMacroContext shall execute them all and return the last result
(... | null | https://raw.githubusercontent.com/whamtet/Excel-REPL/cae2ef8e423e2f2723c60e4758785973f06c6ba4/Excel-REPL/nrepl/excel_repl/schedule_udf.clj | clojure | for ns we will concatenate a list of namespaces to compile
ExportUDFS will invoke a fixed function that compiles them
for in-macro-context we shall concatenate a list of fuctions to execute
INVOKEMacroContext shall execute them all and return the last result | (ns excel-repl.schedule-udf)
ok , two strategies
(def nss (ref []))
(def fns (ref []))
(defn add-ns [ns]
(dosync
(alter nss conj ns)))
(defn add-curr-ns []
(add-ns *ns*))
(defn add-fn [fn]
(dosync
(alter fns conj fn)))
(defn get-ns []
(dosync
(let [a @nss]
(ref-set nss [])
a)))
(defn ... |
b9911bced31630a3faaddb8bd1b606de99518b8713bea3692b1c71d80bc69040 | astynax/hemmet | Template.hs | module Hemmet.FileTree.Template
( template
) where
import Data.Text as T
import Hemmet.Megaparsec
import Hemmet.Tree
import Hemmet.FileTree.Tree
template :: Parser FileTree
template = (Directory <$> item `sepBy` char ' ') <* eof
item :: Parser (Node FileTreePayload)
item = name >>= \n -> directory n <|> file n... | null | https://raw.githubusercontent.com/astynax/hemmet/0ee76cc4ffca5726f8a70ab78ae8473232b96ee3/src/Hemmet/FileTree/Template.hs | haskell | module Hemmet.FileTree.Template
( template
) where
import Data.Text as T
import Hemmet.Megaparsec
import Hemmet.Tree
import Hemmet.FileTree.Tree
template :: Parser FileTree
template = (Directory <$> item `sepBy` char ' ') <* eof
item :: Parser (Node FileTreePayload)
item = name >>= \n -> directory n <|> file n... | |
8beea27ac0cbb63e7ace660de3aa4b817719bdce3e3e2908d6cb4b0f7e31c1b1 | racket/racket7 | linklet.rkt | #lang racket/base
(require "linklet-info.rkt"
"../host/linklet.rkt"
(prefix-in bootstrap: "../run/linklet.rkt"))
(provide skip-abi-imports
linklets-are-source-mode?)
;; Skip over syntax literals and instance:
(define (skip-abi-imports l)
(list-tail l 2))
;; Detect source mode, which enab... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/expander/extract/linklet.rkt | racket | Skip over syntax literals and instance:
Detect source mode, which enables final assembly | #lang racket/base
(require "linklet-info.rkt"
"../host/linklet.rkt"
(prefix-in bootstrap: "../run/linklet.rkt"))
(provide skip-abi-imports
linklets-are-source-mode?)
(define (skip-abi-imports l)
(list-tail l 2))
(define (linklets-are-source-mode? linklets)
(define bootstrap-mode?
(... |
7163c40441f36cd3b3cb3c542d7a4fb8ea76f68306de655e9cca1698444ed174 | haskell-suite/base | Windows.hs | # LANGUAGE Trustworthy #
# LANGUAGE CPP #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE NoImplicitPrelude #
-----------------------------------------------------------------------------
-- |
Module : GHC.Windows
Copyright : ( c ) The University of Glasgow , 2009
-- License : see libraries/base/... | null | https://raw.githubusercontent.com/haskell-suite/base/1ee14681910c76d0a5a436c33ecf3289443e65ed/GHC/Windows.hs | haskell | ---------------------------------------------------------------------------
|
License : see libraries/base/LICENSE
Maintainer :
Stability : internal
Portability : non-portable
available yet. We should move some Win32 functionality down here,
maybe as part of the grand reorganisation of the base ... | # LANGUAGE Trustworthy #
# LANGUAGE CPP #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE NoImplicitPrelude #
Module : GHC.Windows
Copyright : ( c ) The University of Glasgow , 2009
Windows functionality used by several modules .
ToDo : this just duplicates part of System . Win32.Types , which is ... |
97b14d60aeaf2444c032392c78e1e014b560f9b68b28afed7d31643a66dfbec4 | kyleburton/sandbox | swing.clj |
(ns com.github.kyleburton.sandbox.swing
(:import (javax.swing JPanel JPasswordField JFrame JLabel JComponent
JButton SwingUtilities UIManager
JTable JScrollPane)
(java.awt GridLayout FlowLayout GridBagLayout BorderLayout GridLayout)
(java.awt.ev... | null | https://raw.githubusercontent.com/kyleburton/sandbox/cccbcc9a97026336691063a0a7eb59293a35c31a/clojure-utils/kburton-clojure-utils/src/main/clj/com/github/kyleburton/sandbox/swing.clj | clojure |
(close-and-destroy-ui)
TODO: double-clicking on a name should either invoke sql-browse-table or sql-describe-table |
(ns com.github.kyleburton.sandbox.swing
(:import (javax.swing JPanel JPasswordField JFrame JLabel JComponent
JButton SwingUtilities UIManager
JTable JScrollPane)
(java.awt GridLayout FlowLayout GridBagLayout BorderLayout GridLayout)
(java.awt.ev... |
27edc09fe3a927decec8e7f18f2d7d4a325bda8c8ff6ae2792a6285969df2880 | wireapp/wire-server | Typing.hs | -- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License... | null | https://raw.githubusercontent.com/wireapp/wire-server/6c4b00ec111e853871564687862a19658d04ea4f/libs/wire-api/src/Wire/API/Conversation/Typing.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public License along
module Wire.API.Conversation.Typ... |
a3c6b142c5a82034954dad0d83a41b10150cf083f5cc0b46a982fa9c6209dbce | facebook/flow | lints.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/fea668a765d27c12dc02fc79fdbb9374d235134b/src/common/lints/lints.ml | ocaml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | |
fcd28f02564d2102b87d188dec262b32e1a14e611fb7a92b96583f0096eed096 | Opetushallitus/ataru | auth_utils.clj | (ns ataru.virkailija.authentication.auth-utils
(:require
[ataru.config.url-helper :refer [resolve-url]]))
(defn cas-auth-url
[]
(resolve-url :cas.login))
| null | https://raw.githubusercontent.com/Opetushallitus/ataru/2d8ef1d3f972621e301a3818567d4e11219d2e82/src/clj/ataru/virkailija/authentication/auth_utils.clj | clojure | (ns ataru.virkailija.authentication.auth-utils
(:require
[ataru.config.url-helper :refer [resolve-url]]))
(defn cas-auth-url
[]
(resolve-url :cas.login))
| |
f148fb691e42e5f66f6f56938ab2d706809f2425b486129b0193d3584fa3f6b4 | kupl/FixML | sub107.ml |
type aexp =
| Const of int
| Var of string
| Power of string * int
| Times of aexp list
| Sum of aexp list
let diff : aexp * string -> aexp
= fun (e,x) ->
let rec rev_list lst num = (match lst with
| hd::tl -> if List.length tl = num then []@rev_list tl n... | null | https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/differentiate/diff1/submissions/sub107.ml | ocaml |
type aexp =
| Const of int
| Var of string
| Power of string * int
| Times of aexp list
| Sum of aexp list
let diff : aexp * string -> aexp
= fun (e,x) ->
let rec rev_list lst num = (match lst with
| hd::tl -> if List.length tl = num then []@rev_list tl n... | |
a4d40547a1c48cd82f21afaf26e6828ce5b4dbcf857a20c907a5bb95fd6b90a9 | bmeurer/ocaml-experimental | frx_fillbox.ml | (***********************************************************************)
(* *)
MLTk , Tcl / Tk interface of Objective Caml
(* *)
, , and ... | null | https://raw.githubusercontent.com/bmeurer/ocaml-experimental/fe5c10cdb0499e43af4b08f35a3248e5c1a8b541/otherlibs/labltk/frx/frx_fillbox.ml | ocaml | *********************************************************************
described in file LICENSE found in the... | MLTk , Tcl / Tk interface of Objective Caml
, , and
projet Cristal , INRIA Rocquencourt
, Kyoto University RIMS
Copyright 2002 Institut National de Recherche en Informatique et
en Automatique and... |
ebf433fc005bf70ba9de6d41fdbe9d3a186fe7a60928fc37f14aebc2b22d28b1 | sbcl/sbcl | entry.lisp | ;;;; Code in this file handles VM-independent details of run-time
;;;; function representation that primarily concern IR2 conversion and
;;;; the dumper/loader.
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was... | null | https://raw.githubusercontent.com/sbcl/sbcl/5c84fb3414e323f5373a4c1a59b0716d84d5c916/src/compiler/entry.lisp | lisp | Code in this file handles VM-independent details of run-time
function representation that primarily concern IR2 conversion and
the dumper/loader.
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more informat... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-C")
This phase runs before IR2 conversion , initializing each XEP 's
(defun entry-analyze (component)
(l... |
32bc584584e3a13ac41814bb157803e0c06137d3e92585cf9711c9a740e044d1 | lthms/spatial-sway | event.ml | type event_type =
| Workspace
| Mode
| Window
| Barconfig_update
| Binding
| Shutdown
| Tick
| Bar_state_update
| Input
let event_type_code = function
| Workspace -> 0x80000000l
| Mode -> 0x80000002l
| Window -> 0x80000003l
| Barconfig_update -> 0x80000004l
| Binding -> 0x80000005l
| Shut... | null | https://raw.githubusercontent.com/lthms/spatial-sway/9eff6dfe69b504373abba1696bfe47f75535af34/lib/sway_ipc_types/event.ml | ocaml | type event_type =
| Workspace
| Mode
| Window
| Barconfig_update
| Binding
| Shutdown
| Tick
| Bar_state_update
| Input
let event_type_code = function
| Workspace -> 0x80000000l
| Mode -> 0x80000002l
| Window -> 0x80000003l
| Barconfig_update -> 0x80000004l
| Binding -> 0x80000005l
| Shut... | |
187e3e360849e7009762258cb442694a73aaa050a566a10bc5ae002a4d49934e | johnwalker/lein-plz | project-dep-entries.clj | (defproject lein-plz "0.1.1-SNAPSHOT"
:description "A Leiningen plugin for adding dependencies to projects quickly."
:url "-plz.html"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true
:dependencies [[org.clojure/clojurescript "0.0.0"]
[org.clojure/... | null | https://raw.githubusercontent.com/johnwalker/lein-plz/bce53f6a84e8570c103965441353867433f6f985/test/unit/project-dep-entries.clj | clojure | (defproject lein-plz "0.1.1-SNAPSHOT"
:description "A Leiningen plugin for adding dependencies to projects quickly."
:url "-plz.html"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true
:dependencies [[org.clojure/clojurescript "0.0.0"]
[org.clojure/... | |
186c4b90949f900ac21d3b54ce73dfb11a474ba8aa4562e66b901fd705e939a0 | tomhanika/conexp-clj | socialanalytics.clj | ;; Copyright ⓒ the conexp-clj developers; all rights reserved.
;; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( -1.0.php )
;; which can be found in the file LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bou... | null | https://raw.githubusercontent.com/tomhanika/conexp-clj/5e4c15697f06446f925f53d1d143528155d7dd3a/src/main/clojure/conexp/fca/applications/socialanalytics.clj | clojure | Copyright ⓒ the conexp-clj developers; all rights reserved.
The use and distribution terms for this software are covered by the
which can be found in the file LICENSE at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not re... | Eclipse Public License 1.0 ( -1.0.php )
(ns conexp.fca.applications.socialanalytics
"Provides some functionallity for Socialanalytics."
(:require [conexp.fca.contexts :refer [objects
attributes
object-derivation
... |
757c565d86b71e1b127dd1b6a2492d72e409d7494c06d933cfb74181e9e93b01 | pgourlain/vscode_erlang | vscode_erlfmt_scan.erl | Copyright ( c ) Facebook , Inc. and its affiliates .
%%
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,... | null | https://raw.githubusercontent.com/pgourlain/vscode_erlang/e6786db5b0861cb4bb89f96416b2eee1da02d404/apps/erlangbridge/src/vscode_erlfmt_scan.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 ( c ) Facebook , Inc. and its affiliates .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(vscode_erlfmt_scan).
-include("vscode_erlfmt_scan.hrl").
-export([
io_node/1,
string_node/1,
continu... |
8e994c7037b8f411f5bb15bc1529650eed9f6e028cdee86aa6621b74506643af | stan-dev/stanc3 | stanc.ml | * stanc console application
open Core_kernel
open Core_kernel.Poly
open Frontend
open Stan_math_backend
open Analysis_and_optimization
open Middle
(** The main program. *)
let version = "%%NAME%%3 %%VERSION%%"
let name = "%%NAME%%"
(** The usage message. *)
let usage = "Usage: " ^ name ^ " [option] ... <model_file.... | null | https://raw.githubusercontent.com/stan-dev/stanc3/975b2132890f2f6008875cee722ae4f766501952/src/stanc/stanc.ml | ocaml | * The main program.
* The usage message.
* Some example command-line options here
is_prefix is used to also cover the --include-paths=...
must be before typecheck to fix up deprecated syntax which gets rejected
Parse the arguments.
Deal with multiple modalities
if we only have functions, always compile as s... | * stanc console application
open Core_kernel
open Core_kernel.Poly
open Frontend
open Stan_math_backend
open Analysis_and_optimization
open Middle
let version = "%%NAME%%3 %%VERSION%%"
let name = "%%NAME%%"
let usage = "Usage: " ^ name ^ " [option] ... <model_file.stan[functions]>"
let model_file = ref ""
let pret... |
48fa8a8ad407df031135b301b60be9d446d612b1a7c231ea2871e4bf247d74a0 | dreyk/etsdb | etsdb_vnode_put_proxy.erl | %% -------------------------------------------------------------------
%%
%%
Copyright ( c ) Dreyk . All Rights Reserved .
%%
This file is provided to you 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 th... | null | https://raw.githubusercontent.com/dreyk/etsdb/f0bca0cb09ff4b692b8370749a995922545e6f4e/src/etsdb_vnode_put_proxy.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissi... | Copyright ( c ) Dreyk . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(etsdb_vnode_put_proxy).... |
6d6c57dff01bdee999e14a9fd6210a9b220de6cc2895953fb4ed0b51452c5d73 | rkallos/wrek | wrek_exec.erl | -module(wrek_exec).
-export([exec/4]).
-type env() :: [{string(), string()}].
-spec exec(file:filename_all(), string(), env(), fun()) ->
{ok, pid(), integer()} | {error, _}.
exec(Dir0, Cmd0, Env, EventFun) ->
Fun = fun(Fd, _OsPid, Data) ->
EventFun({Fd, Data})
end,
Dir = case Dir0 of
... | null | https://raw.githubusercontent.com/rkallos/wrek/3859e9efdf21227e6e8e0ea81095b229eceb6641/src/wrek_exec.erl | erlang | -module(wrek_exec).
-export([exec/4]).
-type env() :: [{string(), string()}].
-spec exec(file:filename_all(), string(), env(), fun()) ->
{ok, pid(), integer()} | {error, _}.
exec(Dir0, Cmd0, Env, EventFun) ->
Fun = fun(Fd, _OsPid, Data) ->
EventFun({Fd, Data})
end,
Dir = case Dir0 of
... | |
4ac8636d7a97f9f7da4398f27d5e43b811351e0a43fc71fa80bb03e8b21a8518 | dylex/haskell-nfs | Array.hs | -- |Various kinds of arrays (lists, vectors, bytestrings) with statically aserted length constraints encoded in their type.
# LANGUAGE DataKinds #
# LANGUAGE ExplicitNamespaces #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE Ty... | null | https://raw.githubusercontent.com/dylex/haskell-nfs/33e8b9c7f20a05f91bb01e4c0a998ae749122a73/rpc/Network/ONCRPC/XDR/Array.hs | haskell | |Various kinds of arrays (lists, vectors, bytestrings) with statically aserted length constraints encoded in their type.
|A 'ByteString' that uses hex (base16) for 'Read'/'Show'.
|Allows either hex or character input, dynamically.
See also IsSquence
|Assertion that the contained array satisfies @'compareLength' a ... |
# LANGUAGE DataKinds #
# LANGUAGE ExplicitNamespaces #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
{ - # OPTIONS_GHC -Wno - redundant - constraints # - }
module Network.ONCRPC.XDR.Array
( KnownNat
, Know... |
c321f194a5ed51a7c5a5ab73a2d6483b15904a94296e1708efac5cde2ef4231e | dwayne/haskell-programming | ex4.hs | dodgy x y = x + y * 10
oneIsOne = dodgy 1
oneIsTwo = (flip dodgy) 2
oneIsOne y = = 1 + y * 10
--
oneIsTwo x = = x + 2 * 10
= = x + 20
1 . dodgy 1 0 = 1 + 0 * 10 = 1
2 . dodgy 1 1 = 1 + 1 * 10 = 11
3 . dodgy 2 2 = 2 + 2 * 10 = 22
4 . dodgy 1 2 = 1 + 2 * 10 = 21
5 . dodgy 2 1 = 2 + 1 * 1... | null | https://raw.githubusercontent.com/dwayne/haskell-programming/d08679e76cfd39985fa2ee3cd89d55c9aedfb531/ch7/ex4.hs | haskell | dodgy x y = x + y * 10
oneIsOne = dodgy 1
oneIsTwo = (flip dodgy) 2
oneIsOne y = = 1 + y * 10
oneIsTwo x = = x + 2 * 10
= = x + 20
1 . dodgy 1 0 = 1 + 0 * 10 = 1
2 . dodgy 1 1 = 1 + 1 * 10 = 11
3 . dodgy 2 2 = 2 + 2 * 10 = 22
4 . dodgy 1 2 = 1 + 2 * 10 = 21
5 . dodgy 2 1 = 2 + 1 * 10 =... | |
0a5a0c67791157bb97689539799fe0de6d44efcc506deba9b1f1a09aa244098c | Clojure2D/clojure2d | core.clj | (ns clojure2d.core
"Main Clojure2d entry point for Canvas, Window and drawing generatively.
Basic concepts:
* Image - `BufferedImage` java object used to store ARGB color information.
* Canvas - Image which contains graphical context. You draw on it. Similar to processing Graphics object.
* Window - ... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d/c34b435ef86941c8121dc4802e0ccbc0a6ce949f/src/clojure2d/core.clj | clojure | ## Image
Saving image is more tricky. Again, most concepts are taken from Processing.
For provided image object and filename process goes as follows:
* create all necessary folders
* extract file extension and create image writer object
JPG requires flatten image and we must set the quality defined in... | (ns clojure2d.core
"Main Clojure2d entry point for Canvas, Window and drawing generatively.
Basic concepts:
* Image - `BufferedImage` java object used to store ARGB color information.
* Canvas - Image which contains graphical context. You draw on it. Similar to processing Graphics object.
* Window - ... |
b5eedc973abc045a2155a6d149b84f1ede7ab7c46ad0fc7c72f8ceff03641615 | disconcision/fructure | temp4.rkt | #lang racket
(require (for-syntax racket/match racket/list racket/syntax))
(begin-for-syntax
(define-syntax-rule (map-into source [<pattern> <payload> ...] ...)
(letrec ([recursor (match-lambda
[<pattern> <payload> ...] ...
[(? list? x) (map recursor x)]
... | null | https://raw.githubusercontent.com/disconcision/fructure/d434086052eab3c450f631b7b14dcbf9358f45b7/archive/tests/temp4.rkt | racket | #lang racket
(require (for-syntax racket/match racket/list racket/syntax))
(begin-for-syntax
(define-syntax-rule (map-into source [<pattern> <payload> ...] ...)
(letrec ([recursor (match-lambda
[<pattern> <payload> ...] ...
[(? list? x) (map recursor x)]
... | |
8c2938462a3d67d0607ddb5bbc5561028294ea3f8356be53465629a3afde9fd2 | jonascarpay/calligraphy | Calligraphy.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module Calligraphy (main, mainWithConfig) where
import Calligraphy.Compat.Debug (ppHieFile)
import qualified Calligraphy.Compat.GHC as GHC
import Calligraphy.Phases.DependencyFilter
import Calligraphy.Phases.EdgeCleanup
import Calligraphy.Phases.NodeFilt... | null | https://raw.githubusercontent.com/jonascarpay/calligraphy/94fc61e4f325a231cf582b38acde0a96b2001f4a/src/Calligraphy.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE RecordWildCards #
module Calligraphy (main, mainWithConfig) where
import Calligraphy.Compat.Debug (ppHieFile)
import qualified Calligraphy.Compat.GHC as GHC
import Calligraphy.Phases.DependencyFilter
import Calligraphy.Phases.EdgeCleanup
import Calligraphy.Phases.NodeFilter
import Calligraphy.Phases.Parse
... |
50b36c39d7e8717796fffe39db48526009c1f15794e51be3916c96a4802ac69f | ptaoussanis/tempura | tempura.cljc | (ns taoensso.tempura
"Pure Clojure/Script i18n translations library."
{:author "Peter Taoussanis (@ptaoussanis)"}
(:require
[clojure.string :as str]
[taoensso.encore :as enc :refer [have have?]]
[taoensso.tempura.impl :as impl :refer []]))
(enc/assert-min-encore-version [3 31 0])
(def ^:dynamic ... | null | https://raw.githubusercontent.com/ptaoussanis/tempura/f9ec1bc33318c4a53a643f57d3a1f0e9688b5ac6/src/taoensso/tempura.cljc | clojure |
(fn [vargs]) -> <compiled-resource>
Completely arb, full control
[:span "foo" "bar"] -> "foobar", etc. (uncached)
Avoid for Reactjs
(fn [args]) -> result (uncached)
Locale
You can nest ids if you like
Note Clojure fn-style %1 args
Can alias entries
Can alias entire subtrees
Inline edn content loaded from d... | (ns taoensso.tempura
"Pure Clojure/Script i18n translations library."
{:author "Peter Taoussanis (@ptaoussanis)"}
(:require
[clojure.string :as str]
[taoensso.encore :as enc :refer [have have?]]
[taoensso.tempura.impl :as impl :refer []]))
(enc/assert-min-encore-version [3 31 0])
(def ^:dynamic ... |
fe65d46b6a05963d8db6fa1b03b9b1085de950f801e4afbc702008eddae0fca8 | sifbiri/project-resources-operations | session.cljs | (ns app.model.session
(:require
[app.application :refer [SPA]]
[com.fulcrologic.fulcro.routing.dynamic-routing :as dr]
[com.fulcrologic.fulcro.ui-state-machines :as uism]
[taoensso.timbre :as log]
[com.fulcrologic.fulcro.components :as comp]
[com.fulcrologic.fulcro.mutations :as m :refer [defm... | null | https://raw.githubusercontent.com/sifbiri/project-resources-operations/b08adb09ef03f123ca7ad19ec1c2bdc070a66291/src/main/app/model/session.cljs | clojure | [app.ui.root :refer [set-resource-lines]] | (ns app.model.session
(:require
[app.application :refer [SPA]]
[com.fulcrologic.fulcro.routing.dynamic-routing :as dr]
[com.fulcrologic.fulcro.ui-state-machines :as uism]
[taoensso.timbre :as log]
[com.fulcrologic.fulcro.components :as comp]
[com.fulcrologic.fulcro.mutations :as m :refer [defm... |
08cee792febe094e76bcfa0f010f5e25d697372d11179fdd6ea54c38360bc2c5 | gonzojive/elephant | gdcm.lisp | gdcm.lisp -- This file implements generational data collection management
;; based on the basic data collection management functionality.
;; The basic idea is that every object in the collection exists
;; within a generation. Each generation can have a different storage
;; strategy --- in general, the lower the gen... | null | https://raw.githubusercontent.com/gonzojive/elephant/b29a012ab75ccea2fc7fc4f1e9d5e821f0bd60bf/src/contrib/rread/dcm/gdcm.lisp | lisp | based on the basic data collection management functionality.
The basic idea is that every object in the collection exists
within a generation. Each generation can have a different storage
strategy --- in general, the lower the generation number, the
faster and smaller the storage strategy.
Increasing the gen... | gdcm.lisp -- This file implements generational data collection management
One fundamental feature of a GenDir is that the
(in-package "DCM")
(defclass GenDir (director)
((strategy
:accessor strategy)
(final-strategy :initform 'elephant
:accessor final-strategy)
(subdirs
:initform nil
... |
4fc08d8b3ab1c8c714b5d405618db6ba47c687f62038ae57bcd8429579f10ffd | xmonad/xmonad-contrib | Script.hs | -----------------------------------------------------------------------------
-- |
-- Module : XMonad.Hooks.Script
-- Description : Simple interface for running a ~\/.xmonad\/hooks script with the name of a hook.
Copyright : ( c ) < >
-- License : BSD3-style (see LICENSE)
--
Maintainer : < >
-- ... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/3058d1ca22d565b2fa93227fdde44d8626d6f75d/XMonad/Hooks/Script.hs | haskell | ---------------------------------------------------------------------------
|
Module : XMonad.Hooks.Script
Description : Simple interface for running a ~\/.xmonad\/hooks script with the name of a hook.
License : BSD3-style (see LICENSE)
Stability : unstable
Portability : unportable
Provides a simple... | Copyright : ( c ) < >
Maintainer : < >
module XMonad.Hooks.Script (
execScriptHook
) where
import XMonad
execScriptHook :: String -> X ()
execScriptHook hook = do
xmonadDir <- asks (cfgDir . directories)
let script = xmonadDir ++ "/hooks "
spawn (script ++ hook)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.