_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 |
|---|---|---|---|---|---|---|---|---|
b62941e1bb715722a18a6f45eafac546f47cf35b000d5177828b2b033d456421 | helpshift/hydrox | anchors_test.clj | (ns hydrox.doc.link.anchors-test
(:use midje.sweet)
(:require [hydrox.doc.link.anchors :refer :all]))
^{:refer hydrox.doc.link.anchors/link-anchors-lu :added "0.1"}
(fact "creates the anchor lookup for tags and numbers"
(-> {:articles {"example" {:elements [{:type :chapter :tag "hello" :number "1"}]}}}
(li... | null | https://raw.githubusercontent.com/helpshift/hydrox/2beb3c56fad43bbf16f07db7ee72c5862978350c/test/hydrox/doc/link/anchors_test.clj | clojure | (ns hydrox.doc.link.anchors-test
(:use midje.sweet)
(:require [hydrox.doc.link.anchors :refer :all]))
^{:refer hydrox.doc.link.anchors/link-anchors-lu :added "0.1"}
(fact "creates the anchor lookup for tags and numbers"
(-> {:articles {"example" {:elements [{:type :chapter :tag "hello" :number "1"}]}}}
(li... | |
3049be558dcd2c0d8f6325549b6db5f756bfa056dca1a0b17d3b9526809a19c7 | joneshf/open-source | Golden.hs | # LANGUAGE DataKinds #
module Rollbar.Golden where
import Data.Proxy (Proxy(Proxy))
import Rollbar.Item (Item)
import Rollbar.QuickCheck ()
import Test.Aeson.GenericSpecs (roundtripAndGoldenSpecs)
import Test.Hspec (hspec)
main :: IO ()
main =
hspec $ roundtripAndGoldenSpecs (Proxy :: Proxy (It... | null | https://raw.githubusercontent.com/joneshf/open-source/e3412fc68c654d89a8d3af4e12ac19c70e3055ec/packages/rollbar-hs/test/Rollbar/Golden.hs | haskell | # LANGUAGE DataKinds #
module Rollbar.Golden where
import Data.Proxy (Proxy(Proxy))
import Rollbar.Item (Item)
import Rollbar.QuickCheck ()
import Test.Aeson.GenericSpecs (roundtripAndGoldenSpecs)
import Test.Hspec (hspec)
main :: IO ()
main =
hspec $ roundtripAndGoldenSpecs (Proxy :: Proxy (It... | |
c9f587b0e8b3bb0a7ab96227b6bbb9a458359c544fe4ee1f89f0dc5f5ae82f9b | BradWBeer/clinch | default-shaders.lisp | ;;; default-shaders.lisp
Please see the licence.txt for the CLinch
(in-package #:clinch)
(defparameter *generic-shader-hash-table* (make-hash-table))
(defun get-generic-single-texture-shader ()
"Creates/returns a shader-program which blits a texture to an entity.
Uniforms:
P: projection matrix
M: mode... | null | https://raw.githubusercontent.com/BradWBeer/clinch/421de1e4844a5142e37cb06805bc2d9d13ba048f/default-shaders.lisp | lisp | default-shaders.lisp | Please see the licence.txt for the CLinch
(in-package #:clinch)
(defparameter *generic-shader-hash-table* (make-hash-table))
(defun get-generic-single-texture-shader ()
"Creates/returns a shader-program which blits a texture to an entity.
Uniforms:
P: projection matrix
M: model-view matrix
t1: tex... |
d9bdf50bf0f2e5ab6ccaa19d83938991ee6639b3d63b5c3e628a3997f9fb3df9 | evturn/haskellbook | 14.06-coarbitrary.hs | # LANGUAGE DeriveGeneric #
module CoArbitrary where
import GHC.Generics
import Test.QuickCheck
data Bool' = True'
| False'
deriving Generic
instance CoArbitrary Bool'
trueGen :: Gen Int
trueGen = coarbitrary True' arbitrary
falseGen :: Gen Int
falseGen = coarbitrary False... | null | https://raw.githubusercontent.com/evturn/haskellbook/3d310d0ddd4221ffc5b9fd7ec6476b2a0731274a/14/14.06-coarbitrary.hs | haskell | # LANGUAGE DeriveGeneric #
module CoArbitrary where
import GHC.Generics
import Test.QuickCheck
data Bool' = True'
| False'
deriving Generic
instance CoArbitrary Bool'
trueGen :: Gen Int
trueGen = coarbitrary True' arbitrary
falseGen :: Gen Int
falseGen = coarbitrary False... | |
c5d30d30a8eb3c322be0ed925d428b49126a4d2453283b8efbcd9c7a4befb856 | default-kramer/plisqin | schema.rkt | #lang racket
(provide (all-defined-out))
(require plisqin
plisqin-examples/adventure-works)
(define-schema adventure-works-schema
(table Department
#:column
[DepartmentID #:type Number? #:null no]
[GroupName #:type String? #:null no]
[ModifiedDate #:type Datetime? #:nul... | null | https://raw.githubusercontent.com/default-kramer/plisqin/26421c7c42656c873c4e0a4fc7f48c0a3ed7770f/plisqin-examples/adventure-works/schema.rkt | racket | this is a plural join: | #lang racket
(provide (all-defined-out))
(require plisqin
plisqin-examples/adventure-works)
(define-schema adventure-works-schema
(table Department
#:column
[DepartmentID #:type Number? #:null no]
[GroupName #:type String? #:null no]
[ModifiedDate #:type Datetime? #:nul... |
502819da43e80b68cf7096a5465fd007f2ad038e5c605ad5840d532142e24d90 | f-me/carma-public | CtrModel.hs | module Carma.Model.CtrModel where
import Data.Text
import Data.Typeable
import Data.Model
import Data.Model.View
import Carma.Model.Types()
import Carma.Model.PgTypes()
data CtrModel = CtrModel
{ident :: PK Int CtrModel ""
,value :: F Text "value" "Название модели"
,label :: F Text "label" "Человекопо... | null | https://raw.githubusercontent.com/f-me/carma-public/82a9f44f7d919e54daa4114aa08dfec58b01009b/carma-models/src/Carma/Model/CtrModel.hs | haskell | module Carma.Model.CtrModel where
import Data.Text
import Data.Typeable
import Data.Model
import Data.Model.View
import Carma.Model.Types()
import Carma.Model.PgTypes()
data CtrModel = CtrModel
{ident :: PK Int CtrModel ""
,value :: F Text "value" "Название модели"
,label :: F Text "label" "Человекопо... | |
d5e5547fc85a1a0dc827b238363458c297e9582e3cea802834c473dff60101f5 | mirleft/ocaml-tls | reader.mli |
type error =
| TrailingBytes of string
| WrongLength of string
| Unknown of string
| Underflow
| Overflow of int
| UnknownVersion of (int * int)
| UnknownContent of int
val pp_error : error Fmt.t
val parse_version : Cstruct.t -> (Core.tls_version, error) result
val parse_any_versio... | null | https://raw.githubusercontent.com/mirleft/ocaml-tls/30f0a8680bfbd537c0918ea63ac04c5cc08555cf/lib/reader.mli | ocaml |
type error =
| TrailingBytes of string
| WrongLength of string
| Unknown of string
| Underflow
| Overflow of int
| UnknownVersion of (int * int)
| UnknownContent of int
val pp_error : error Fmt.t
val parse_version : Cstruct.t -> (Core.tls_version, error) result
val parse_any_versio... | |
9fb300bce06dcd5dc809ddf3ba5ea19d3db1ba3fc59732c4aee980f4f93653c0 | JacquesCarette/Drasil | Thermodynamics.hs | -- | Defines concepts used in the field of thermodynamics.
module Data.Drasil.Concepts.Thermodynamics where
import Language.Drasil
import Utils .
import Language.Drasil.Chunk.Concept.NamedCombinators
import Data.Drasil.Concepts.Documentation (source, theory)
import Data.Drasil.Concepts.Physics (energy)
-- | Collect... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/a1c22b739c958ae169e8fe4fb2ea2b0a670dc7df/code/drasil-data/lib/Data/Drasil/Concepts/Thermodynamics.hs | haskell | | Defines concepts used in the field of thermodynamics.
| Collects all thermodynamics-related concepts.
FIXME: "Boiling" is not a noun. How should we deal with it?
Same for "Melting" | module Data.Drasil.Concepts.Thermodynamics where
import Language.Drasil
import Utils .
import Language.Drasil.Chunk.Concept.NamedCombinators
import Data.Drasil.Concepts.Documentation (source, theory)
import Data.Drasil.Concepts.Physics (energy)
thermocon :: [ConceptChunk]
thermocon = [boilPt, boiling, degree_', ene... |
d15decaef5dfaaafe10188f2e93e4fce042c4f536d098c90a925875ba73c7584 | GillianPlatform/Gillian | gillian_c.ml | open Cgil_lib
module SMemory = Gillian.Monadic.MonadicSMemory.Lift (MonadicSMemory)
module Gil_to_c_lifter
(Verification : Gillian.Abstraction.Verifier.S
with type annot = CParserAndCompiler.Annot.t) =
struct
include
Gillian.Debugger.Lifter.Gil_lifter.Make (CParserAndCompiler) (Verifica... | null | https://raw.githubusercontent.com/GillianPlatform/Gillian/a8f5836522cc73eeae01932579c2a68446d57f62/Gillian-C/bin/gillian_c.ml | ocaml | open Cgil_lib
module SMemory = Gillian.Monadic.MonadicSMemory.Lift (MonadicSMemory)
module Gil_to_c_lifter
(Verification : Gillian.Abstraction.Verifier.S
with type annot = CParserAndCompiler.Annot.t) =
struct
include
Gillian.Debugger.Lifter.Gil_lifter.Make (CParserAndCompiler) (Verifica... | |
7c3840d90f55a0b8073c82a03ca467526b8f9d84daac2394bb27e11148a024c5 | racket/old-plt | util.scm | Copyright ( C ) 1997 , Universite ' de Montre'al .
; All rights reserved.
; SILex 1.0.
;
definitions de constantes
;
(define eof-tok 0)
(define hblank-tok 1)
(define vblank-tok 2)
(define pipe-tok 3)
(define question-tok 4)
(define plus-tok 5)
(... | null | https://raw.githubusercontent.com/racket/old-plt/a580d75deae2a0d2f3d8a93bc3c4f8f1f619b5b7/collects/java/SILexSource/util.scm | scheme | All rights reserved.
SILex 1.0.
Tokens agreges
Fonctions de manipulation des tokens
Fonctions de manipulations des regles
Fonctions de manipulation des ensembles d'etats
Intersection de deux ensembles d'etats
Difference entre deux ensembles d'etats
Decoupage de deux ensembles d'etats
Fonctions de... | Copyright ( C ) 1997 , Universite ' de Montre'al .
definitions de constantes
(define eof-tok 0)
(define hblank-tok 1)
(define vblank-tok 2)
(define pipe-tok 3)
(define question-tok 4)
(define plus-tok 5)
(define star-tok 6)
(define l... |
a79cb92872deb4174c73027d0e62833bf0f04e3e858d40148ebc4e9b747ab7be | realworldocaml/examples | fixed_module.ml | let () =
let module MyString = String in
()
| null | https://raw.githubusercontent.com/realworldocaml/examples/32ea926861a0b728813a29b0e4cf20dd15eb486e/code/front-end/fixed_module.ml | ocaml | let () =
let module MyString = String in
()
| |
3b5fec15dd677dc02d371cd465a2a873744f4078fe578edd052ea92a35445fd0 | patricoferris/ppx_deriving_brr | accessor.ml | open Ppxlib
open Ast_builder.Default
let impl (ld : label_declaration) =
let loc = ld.pld_loc in
pstr_value ~loc Nonrecursive
[
{
pvb_pat = ppat_var ~loc ld.pld_name;
pvb_expr =
pexp_fun ~loc Nolabel None
(ppat_var ~loc { loc; txt = "jv" })
(Common.type_t... | null | https://raw.githubusercontent.com/patricoferris/ppx_deriving_brr/3558226e881cc31ccc9d15b45114f05cf496994f/src/accessor.ml | ocaml | open Ppxlib
open Ast_builder.Default
let impl (ld : label_declaration) =
let loc = ld.pld_loc in
pstr_value ~loc Nonrecursive
[
{
pvb_pat = ppat_var ~loc ld.pld_name;
pvb_expr =
pexp_fun ~loc Nolabel None
(ppat_var ~loc { loc; txt = "jv" })
(Common.type_t... | |
d8fa077d06428c322d3bf8252fb100a2f2297b357c775560b07b8ee2ceab5793 | gbour/letsencrypt-erlang | standalone.erl | Copyright 2015 - 2016
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distributed under ... | null | https://raw.githubusercontent.com/gbour/letsencrypt-erlang/566f16d289f8c968e76fafe26ded22b73d38a3cb/examples/standalone.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 permi... | Copyright 2015 - 2016
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(standalone).
-export([main/1, main/2, main/3, main/4, on_complete/1]).
on_complete({State, Data}) ->
io:format("letsencrypt completed: ~p... |
73a5ba54dd82a9a3bbe31b98b3a8e40561afdf47a0308f2eab1100f04cb18d85 | Javran/advent-of-code | Day6.hs | module Javran.AdventOfCode.Y2022.Day6 (
) where
import Data.List.Split hiding (sepBy)
import Javran.AdventOfCode.Prelude
data Day6 deriving (Generic)
isAllDistinct :: Eq a => [a] -> Bool
isAllDistinct = \case
[] -> True
x : xs -> notElem x xs && isAllDistinct xs
instance Solution Day6 where
solutionRun _ So... | null | https://raw.githubusercontent.com/Javran/advent-of-code/94774a0f355b69edf7c1444f191c041915a9b0c4/src/Javran/AdventOfCode/Y2022/Day6.hs | haskell | module Javran.AdventOfCode.Y2022.Day6 (
) where
import Data.List.Split hiding (sepBy)
import Javran.AdventOfCode.Prelude
data Day6 deriving (Generic)
isAllDistinct :: Eq a => [a] -> Bool
isAllDistinct = \case
[] -> True
x : xs -> notElem x xs && isAllDistinct xs
instance Solution Day6 where
solutionRun _ So... | |
14603e120003903bcaa99d42b19962e4fbc17fa6d9637d21f7c230446a51a1fc | kframework/semantic-approaches | Imp_State.hs | -- This module defines convenience functions for a key value store
module Imp_State where
import qualified Data.Map.Strict as Map
from_list list = Map.fromList (map (\i -> (i, 0)) list)
get key store =
case Map.lookup key store of
Just val -> val
Nothing -> error ((show key... | null | https://raw.githubusercontent.com/kframework/semantic-approaches/6f64eac09e005fe4eae7141e3c0e0f5711da0647/haskell/imp/6-imp%2B%2B/1-imp-bigstep/Imp_State.hs | haskell | This module defines convenience functions for a key value store
Inserts a key into the map, overwriting existing values. Used for the start state of a let statement | module Imp_State where
import qualified Data.Map.Strict as Map
from_list list = Map.fromList (map (\i -> (i, 0)) list)
get key store =
case Map.lookup key store of
Just val -> val
Nothing -> error ((show key) ++ " is not in the store")
update key value store =
... |
6d485f6b1d77966fbfa2f6c52be0c9d57fbb3f79d932591d671fa834d2981a8c | margnus1/kid-mud | npc.erl | Copyright ( c ) 2012 , , and
See the file license.txt for copying permission .
%%%-------------------------------------------------------------------
@author < >
%%% @doc
%%%
%%% @end
Created : 15 May 2012 by < >
%%%-------------------------------------------------------------------
-module(npc).... | null | https://raw.githubusercontent.com/margnus1/kid-mud/56d759593e79d9c8ba7c45f9fc716d65de2554a7/src/npc.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
gen_server callbacks
===================================================================
API
===================================================================
---... | Copyright ( c ) 2012 , , and
See the file license.txt for copying permission .
@author < >
Created : 15 May 2012 by < >
-module(npc).
-include("npc.hrl").
-include_lib("eunit/include/eunit.hrl").
-behaviour(gen_server).
-export([start_link/3, get_ref/1, damage/3, stop_attack/2, player_enter/2,
... |
280005172ca7a7a4da1a679b1330b0784850c70820ec8a3a92daf6323e2229fe | xguerin/ocaml-gridjs | grid.ml |
* Copyright ( c ) 2020 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE A... | null | https://raw.githubusercontent.com/xguerin/ocaml-gridjs/dfc59da2a9e1f32882035dec67b26505eb1baf40/lib/grid.ml | ocaml |
* Copyright ( c ) 2020 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE A... | |
2b8c3dfd529feb36ad0cd681c6846b6d6796f78b48baa772b13a1137eab645ad | urbanslug/wai-devel | CmdArgsSpec.hs | -- Test for command line arguments module.
module Devel.CmdArgsSpec where
import Test.Hspec
import Devel.CmdArgs
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "Command line arguments." $ do
it "We can create values of type CmdArgs" $ do
let cmdArgs' = CmdArgs "Application.hs" "runDevel"... | null | https://raw.githubusercontent.com/urbanslug/wai-devel/6d1c5dc7fe59f8aa3b88b91201e859af9f8a92a4/tests/Devel/CmdArgsSpec.hs | haskell | Test for command line arguments module. | module Devel.CmdArgsSpec where
import Test.Hspec
import Devel.CmdArgs
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "Command line arguments." $ do
it "We can create values of type CmdArgs" $ do
let cmdArgs' = CmdArgs "Application.hs" "runDevel" [] False True
cmdArgs' `shouldBe` (C... |
e293f6a93ee83561300ac7ffe920174a371c3e09eea71cbcb493a8afe72abcc9 | kidpollo/jackdaw-literate-examples | core.clj | (ns simple-app.core)
(defn hello [subject]
(prn (str "Hello " subject)))
(defn -main [target]
(hello target))
| null | https://raw.githubusercontent.com/kidpollo/jackdaw-literate-examples/9f3eca7415c0c4d460ab114eca675901a6c32114/simple-app/src/simple_app/core.clj | clojure | (ns simple-app.core)
(defn hello [subject]
(prn (str "Hello " subject)))
(defn -main [target]
(hello target))
| |
969f924e5a1abcca19b25bb3a385d1f93d530bad1de2823bfd0a1e26f1307489 | dchelimsky/sicp-exercises | ex-1.5.scm | #lang scheme
(define (p) (p))
(define (test x y)
(if (= x 0)
0
y))
(test 0 (p))
; describe what happens with the above with:
; normal-order evaluation
; applicative-order evaluation
;;;;;;;;;;;;;;
; Background
;
; The p function itself results in an infinite loop.
;;;;;;;;;;;;;;
; Normal Order
;
... | null | https://raw.githubusercontent.com/dchelimsky/sicp-exercises/55c804e3775b87a490e05f8337fc59bc7ce07f28/chapter-1/ex-1.5.scm | scheme | describe what happens with the above with:
normal-order evaluation
applicative-order evaluation
Background
The p function itself results in an infinite loop.
Normal Order
this
becomes this
Applicative Order
result: infinite loop
this
becomes this
etc, because (p) expands to (p), which must then b... | #lang scheme
(define (p) (p))
(define (test x y)
(if (= x 0)
0
y))
(test 0 (p))
result : 0
(test 0 (p))
(if (= 0 0) 0 (p))
which returns 0 before ( p ) is ever eval'd
(test 0 (p))
(test 0 (p)) |
f08f00bf4ee70d7df9487baca14c40bc612e3b21e0a8a082860f1d1403ea3111 | CSCfi/rems | categories.clj | (ns rems.api.categories
(:require [compojure.api.sweet :refer :all]
[rems.api.schema :as schema]
[rems.schema-base :as schema-base]
[rems.service.category :as category]
[rems.api.util :refer [not-found-json-response]]
[rems.common.roles :refer [+admin-read-r... | null | https://raw.githubusercontent.com/CSCfi/rems/490087c4d58339c908da792111029fbaf817a26f/src/clj/rems/api/categories.clj | clojure | (ns rems.api.categories
(:require [compojure.api.sweet :refer :all]
[rems.api.schema :as schema]
[rems.schema-base :as schema-base]
[rems.service.category :as category]
[rems.api.util :refer [not-found-json-response]]
[rems.common.roles :refer [+admin-read-r... | |
027db3938d881e5d42186a0048f3e8088b3e7dbcd0c20749bd959e502c6380eb | johnelse/mkaudio | test_beat.ml | open Mkaudio_libs
open OUnit2
let test_parse_kick_pattern _ =
assert_equal
(Beat.parse_patterns ~kick:(Some "1") ~snare:None ~hihat:None)
(Result.Ok [
Beat.({
kick = true;
snare = false;
hihat = false;
});
])
let test_parse_snare_pattern _ =
assert_equal
(Beat.p... | null | https://raw.githubusercontent.com/johnelse/mkaudio/172fc14443feafae2f0542948e53c1621f42bed2/test/test_beat.ml | ocaml | open Mkaudio_libs
open OUnit2
let test_parse_kick_pattern _ =
assert_equal
(Beat.parse_patterns ~kick:(Some "1") ~snare:None ~hihat:None)
(Result.Ok [
Beat.({
kick = true;
snare = false;
hihat = false;
});
])
let test_parse_snare_pattern _ =
assert_equal
(Beat.p... | |
b81d17a0be362a6f7a8b8b3a4d0f764dc1b56e106a95b40b38ea27159f492010 | Octachron/olivine | extension_reader.ml | open Xml.Infix
open Structured_extensions
let errorf x =
Fmt.kpf (fun _ -> Fmt.pf Fmt.stderr "@]@."; exit 2) Fmt.stderr ("@[Fatal extension parsing error:@ " ^^ x)
let int_of_string s =
try int_of_string s with
| Failure _ -> -1 (**FIXME: constant value *)
let etype n = n%("name")
let command n = n%("name")
... | null | https://raw.githubusercontent.com/Octachron/olivine/e93df595ad1e8bad5a8af689bac7d150753ab9fb/info/extension_reader.ml | ocaml | *FIXME: constant value
constants
FIXME: this extension was not promoted properly!
name are now suffixed by "_extension_name" …
TODO: analyze correctly requirements
TODO: analyze correctly requirements | open Xml.Infix
open Structured_extensions
let errorf x =
Fmt.kpf (fun _ -> Fmt.pf Fmt.stderr "@]@."; exit 2) Fmt.stderr ("@[Fatal extension parsing error:@ " ^^ x)
let int_of_string s =
try int_of_string s with
let etype n = n%("name")
let command n = n%("name")
let enum n: Structured_extensions.enum =
let i... |
b5e4553823d162f48492aafeaebd907dbe0de4cdb01845d2fe02d989ef8f5aee | cmoid/erlbutt | pulse.erl | SPDX - License - Identifier : GPL-2.0 - only
%%
Copyright ( C ) 2018 Dionne Associates , LLC .
-module(pulse).
-include("ssb.hrl").
-behaviour(gen_server).
%% API
-export([start_link/0]).
-export([whoami/0]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
termina... | null | https://raw.githubusercontent.com/cmoid/erlbutt/341b3bc0726c85962ac0386a42548aaa4c39ffae/apps/ssb/src/pulse.erl | erlang |
API
gen_server callbacks
===================================================================
API
===================================================================
===================================================================
gen_server callbacks
=============================================================... | SPDX - License - Identifier : GPL-2.0 - only
Copyright ( C ) 2018 Dionne Associates , LLC .
-module(pulse).
-include("ssb.hrl").
-behaviour(gen_server).
-export([start_link/0]).
-export([whoami/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-define(SE... |
f76f87ed744e805b75ada9e4e3568fc1325b225a1f916ecbf8193e4333132586 | weyrick/roadsend-php | php-posix.scm | ;; ***** BEGIN LICENSE BLOCK *****
Roadsend PHP Compiler Runtime Libraries
Copyright ( C ) 2007 Roadsend , Inc.
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation ; either version 2.... | null | https://raw.githubusercontent.com/weyrick/roadsend-php/d6301a897b1a02d7a85bdb915bea91d0991eb158/runtime/ext/standard/php-posix.scm | scheme | ***** BEGIN LICENSE BLOCK *****
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
either version 2.1
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MER... | Roadsend PHP Compiler Runtime Libraries
Copyright ( C ) 2007 Roadsend , Inc.
of the License , or ( at your option ) any later version .
GNU Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Public License
Foundation , Inc. , 51 Franklin Street , Fifth... |
2a977ddba8847f567711a2e68230e7aa48836cf45d214fd96f36dd6ea99dcfe6 | juliangamble/clojure-ants-simulation | AntsAppletRunner.clj | (ns demo.AntsAppletRunner
(:import
(javax.swing JApplet JPanel JLabel JFrame))
(:gen-class
:post-init post-init
:main -main))
;------
(compile 'demo.AntsApplet2)
(defn -main []
(let [applet (new demo.AntsApplet2)]
(doto (JFrame. "Ants")
(.add (.getContentPane applet))
(.pack)
... | null | https://raw.githubusercontent.com/juliangamble/clojure-ants-simulation/9fa218b55e52e4de1fd294a88fff48791c8279c0/src/demo/AntsAppletRunner.clj | clojure | ------
(-main "s") | (ns demo.AntsAppletRunner
(:import
(javax.swing JApplet JPanel JLabel JFrame))
(:gen-class
:post-init post-init
:main -main))
(compile 'demo.AntsApplet2)
(defn -main []
(let [applet (new demo.AntsApplet2)]
(doto (JFrame. "Ants")
(.add (.getContentPane applet))
(.pack)
(.set... |
79f07800d78ee79a0f074f0425db33615b77e0c9b9e19bcbce9a65c65680e26a | OlivierSohn/hamazed | Instrument.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE LambdaCase #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE GeneralizedNewtypeDeriving #
module Imj.Music.Instrument
( -- * Types
Instrument(..)
, SoundSource(..)
, SweepFreqType(..)
, Harmonics(..)
, MusicalEven... | null | https://raw.githubusercontent.com/OlivierSohn/hamazed/c0df1bb60a8538ac75e413d2f5bf0bf050e5bc37/imj-audio/src/Imj/Music/Instrument.hs | haskell | # LANGUAGE DeriveDataTypeable #
* Types
* Analyze envelope
* Utilities
* Some instruments
| These instruments are used in
| Utilities
^ A sinusoïdal oscillator where the volume is adjusted to achieve
<-loudness_contour equal-loudness>.
^ A sinusoïdal oscillator.
^ A saw oscillator.
^ A square oscillator.
^ ... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE LambdaCase #
# LANGUAGE DeriveGeneric #
# LANGUAGE GeneralizedNewtypeDeriving #
module Imj.Music.Instrument
Instrument(..)
, SoundSource(..)
, SweepFreqType(..)
, Harmonics(..)
, MusicalEvent(..)
, InstrumentNote(..)
, mkInstrumentNo... |
9fa647fa07a2a319a6f49a5e028cf4323f0fc3b23ea1fe9d9b4b49881c61994d | TorXakis/TorXakis | StdTDefs.hs |
TorXakis - Model Based Testing
Copyright ( c ) 2015 - 2017 TNO and Radboud University
See LICENSE at root directory of this repository .
TorXakis - Model Based Testing
Copyright (c) 2015-2017 TNO and Radboud University
See LICENSE at root directory of this repository.
-}
-- -----------------------------------... | null | https://raw.githubusercontent.com/TorXakis/TorXakis/038463824b3d358df6b6b3ff08732335b7dbdb53/sys/defs/src/StdTDefs.hs | haskell | ----------------------------------------------------------------------------------------- --
# LANGUAGE OverloadedStrings #
# LANGUAGE MonoLocalBinds #
----------------------------------------------------------------------------------------- --
standard function names
--------------------------------------------... |
TorXakis - Model Based Testing
Copyright ( c ) 2015 - 2017 TNO and Radboud University
See LICENSE at root directory of this repository .
TorXakis - Model Based Testing
Copyright (c) 2015-2017 TNO and Radboud University
See LICENSE at root directory of this repository.
-}
# LANGUAGE FlexibleContexts #
# LANG... |
1adbd588dd4a7423ee3efc9ace5baa76339c22f848c796ad3e4d1e3954e23e47 | Cipherwraith/Rokka | RemoveDats.hs | module Main where
import System.Posix.Time
import System.Directory
import Control.Concurrent
import Data.List
secondsDirectory :: String
secondsDirectory = "/home/serve/script/dats/seconds/"
main :: IO ()
main = do
removeSecondsDats
removeSecondsDats = do
threadDelay 1000000
contents <- getDirContents seconds... | null | https://raw.githubusercontent.com/Cipherwraith/Rokka/46f55dcc5f0c00f2c806670330234b0e7afea5ee/RemoveDats.hs | haskell | module Main where
import System.Posix.Time
import System.Directory
import Control.Concurrent
import Data.List
secondsDirectory :: String
secondsDirectory = "/home/serve/script/dats/seconds/"
main :: IO ()
main = do
removeSecondsDats
removeSecondsDats = do
threadDelay 1000000
contents <- getDirContents seconds... | |
7cbccb7154a42e408d30b8627a6af31d5830f8eb6b69a2d58fa7fcec001b2c83 | c-cube/ocaml-containers | CCArray.ml | (* This file is free software, part of containers. See file "license" for more details. *)
(** {1 Array utils} *)
type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a random_gen = Random.State.t -> 'a
type 'a printer = Format.format... | null | https://raw.githubusercontent.com/c-cube/ocaml-containers/5227fb975c2df67b65edb3715e6e26499c600a6e/src/core/CCArray.ml | ocaml | This file is free software, part of containers. See file "license" for more details.
* {1 Array utils}
* {2 Arrays}
need special case for initializing the result
append [rev a] in front of [acc]
too low
too high
too high
avoid overflow
* all the elements of a, but the i-th, into a list
swap elements o... |
type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a random_gen = Random.State.t -> 'a
type 'a printer = Format.formatter -> 'a -> unit
open CCShims_
[@@@ifge 4.8]
include Array
[@@@elifge 4.6]
include Array
type 'a t = 'a ar... |
ac80312d9ce03bfdd623fa89dcae98b055930baca2638bca3789fc713e5203f5 | wireless-net/erlang-nommu | snmpc_mib_to_hrl.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2011 . All Rights Reserved .
%%
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 Pu... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/snmp/src/compile/snmpc_mib_to_hrl.erl | erlang |
%CopyrightBegin%
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 online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limit... | Copyright Ericsson AB 1996 - 2011 . All Rights Reserved .
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 "
-module(snmpc_mib_to_hrl).
-include_lib("... |
4968ebdfdfde45bdcd18a3153231c0f50ddb92e48bfb4221365043c65f6db9b0 | didierverna/declt | readtable.lisp | readtable.lisp --- management
Copyright ( C ) 2015 , 2017 , 2019 , 2021
Author : < >
This file is part of Declt .
;; Permission to use, copy, modify, and distribute this software for any
;; purpose with or without fee is hereby granted, provided that the above
;; copyright notice and this permission ... | null | https://raw.githubusercontent.com/didierverna/declt/13bb631eaf282a1fb5ebbb30843df6f21bf3983e/setup/src/readtable.lisp | lisp | Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SH... | readtable.lisp --- management
Copyright ( C ) 2015 , 2017 , 2019 , 2021
Author : < >
This file is part of Declt .
THIS SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS... |
81d2f95a093aab2a4a86227a7b250f33d991504ee1bcc29de10ca1a75cc8b1a6 | abxy/hterl | hterl_compiler_tests.erl | -module(hterl_compiler_tests).
-include_lib("eunit/include/eunit.hrl").
hterl_compiler_test_() ->
[
test_ex_testing([]),
test_ex_testing([precompile, {encoding, utf8}])
].
test_ex_testing(Options) ->
{setup,
fun () -> compile_from_examples("ex_testing", Options) end,
[
... | null | https://raw.githubusercontent.com/abxy/hterl/646322a6ab3b62ac8e6dd8bd9d82202cda0ba065/test/hterl_compiler_tests.erl | erlang | -------------------------------------------------------------------------------
Tests
-------------------------------------------------------------------------------
Helpers | -module(hterl_compiler_tests).
-include_lib("eunit/include/eunit.hrl").
hterl_compiler_test_() ->
[
test_ex_testing([]),
test_ex_testing([precompile, {encoding, utf8}])
].
test_ex_testing(Options) ->
{setup,
fun () -> compile_from_examples("ex_testing", Options) end,
[
... |
cecf6af4ab639064609df0f58a2b1469fe3db9e9b6f8ee97c9f60c09d279d819 | racket/distro-build | unpack-collects.rkt | #lang racket/base
(require racket/cmdline
racket/file
racket/port
net/url
file/untgz
"display-time.rkt")
(module test racket/base)
(define dest-dir "bundle/racket")
(define server
(command-line
#:once-each
[("--skip") "don't unpack" (exit 0)]
#:args (server)
... | null | https://raw.githubusercontent.com/racket/distro-build/080f8ccb9b1007a07ac2da25e12d75f18e799eb5/distro-build-client/unpack-collects.rkt | racket | #lang racket/base
(require racket/cmdline
racket/file
racket/port
net/url
file/untgz
"display-time.rkt")
(module test racket/base)
(define dest-dir "bundle/racket")
(define server
(command-line
#:once-each
[("--skip") "don't unpack" (exit 0)]
#:args (server)
... | |
c67c868bfc726a8fd916848245dcbd9b1c07fb5934a619e80bee96f41209dadd | sjl/advent | day-15.lisp | (advent:defpackage* :advent/2019/15 (:shadow :step))
(in-package :advent/2019/15)
(defparameter *animate* nil)
(defparameter *directions* '(#c(0 1) #c(0 -1) #c(-1 0) #c(1 0)))
(defclass* repair-machine ()
((machine)
(input)
(output)
(pos :initform 0)
(world :initform (make-hash-table))
(oxygen-positi... | null | https://raw.githubusercontent.com/sjl/advent/dc3debda9bd1a0570a6ab06919b1af7b285413dc/src/2019/days/day-15.lisp | lisp | backtrack
Scratch -------------------------------------------------------------------- | (advent:defpackage* :advent/2019/15 (:shadow :step))
(in-package :advent/2019/15)
(defparameter *animate* nil)
(defparameter *directions* '(#c(0 1) #c(0 -1) #c(-1 0) #c(1 0)))
(defclass* repair-machine ()
((machine)
(input)
(output)
(pos :initform 0)
(world :initform (make-hash-table))
(oxygen-positi... |
c09b02b34d7f2699e10103660763ffc48ee6185d9c695bac654c711469d80593 | sockjs/sockjs-erlang | sockjs_app.erl | -module(sockjs_app).
-behaviour(application).
-export([start/2, stop/1]).
-spec start(_, _) -> {ok, pid()}.
start(_StartType, _StartArgs) ->
sockjs_session:init(),
sockjs_session_sup:start_link().
-spec stop(_) -> ok.
stop(_State) ->
ok.
| null | https://raw.githubusercontent.com/sockjs/sockjs-erlang/66ea7f3fabac8d0f66aa88a354577b7c6be8fe9a/src/sockjs_app.erl | erlang | -module(sockjs_app).
-behaviour(application).
-export([start/2, stop/1]).
-spec start(_, _) -> {ok, pid()}.
start(_StartType, _StartArgs) ->
sockjs_session:init(),
sockjs_session_sup:start_link().
-spec stop(_) -> ok.
stop(_State) ->
ok.
| |
669011add37dc1fd504094fa379e1cf0746478a0b14071e40d63122e92160ed5 | ymyzk/lambda-dti | main.ml | open Format
open Lambda_dti
let debug = ref false
let rec read_eval_print lexbuf env tyenv =
(* Used in all modes *)
let print f = fprintf std_formatter f in
(* Used in debug mode *)
let print_debug f = Utils.Format.make_print_debug !debug f in
flush stderr;
flush stdout;
if lexbuf.Lexing.lex_curr_p.pos... | null | https://raw.githubusercontent.com/ymyzk/lambda-dti/f476c0094832cbaaa336dc1bc86babfb8b652f14/bin/main.ml | ocaml | Used in all modes
Used in debug mode
Parsing
Type inference
NOTE: Typing.ITGL.translate and Typing.CC.type_of_program expect
* normalized input
Translation
Evaluation
Exiting normally
Exiting with the status code
Unexpected error occurs, close the opened channel | open Format
open Lambda_dti
let debug = ref false
let rec read_eval_print lexbuf env tyenv =
let print f = fprintf std_formatter f in
let print_debug f = Utils.Format.make_print_debug !debug f in
flush stderr;
flush stdout;
if lexbuf.Lexing.lex_curr_p.pos_fname = "" then print "# @?";
begin try
prin... |
7639da557a56a3a2cb21955a33a037e9f8fe221e44fc1c1995af603df251d263 | gtk2hs/gtk2hs | Progress.hs | Example of concurrent and Gtk .
--
As long as GHC does not support OS level threads by default , a trick has
to be used to let programs continue while the GUI is running .
We attach a call to the function " yield " to the timeout handler of
Gtk 's main loop . Thus GHC regularly gets a chance to execute
--... | null | https://raw.githubusercontent.com/gtk2hs/gtk2hs/0f90caa1dae319a0f4bbab76ed1a84f17c730adf/gtk/demo/concurrent/Progress.hs | haskell |
threads.
which gives reasonable latency without the polling generating too much
cpu load. | Example of concurrent and Gtk .
As long as GHC does not support OS level threads by default , a trick has
to be used to let programs continue while the GUI is running .
We attach a call to the function " yield " to the timeout handler of
Gtk 's main loop . Thus GHC regularly gets a chance to execute
impo... |
a8b45c1ff317e9beff27e3da45a5db7baa2a5718dd3e78381745f64d3230a37e | sjsyrek/study-haskell-nyc | lambda-lists.hs | {-#LANGUAGE RankNTypes#-}
data Number a = Number (forall a. (a -> a) -> a -> a)
instance Num a => Show (Number a) where
show (Number f) = show $ f (1 +) 0
zero :: Number a
zero = Number (\f x -> x)
inc :: Number a -> Number a
inc (Number n) = Number (\f x -> f $ n f x)
one :: Number a
one = inc zero
two :: Numb... | null | https://raw.githubusercontent.com/sjsyrek/study-haskell-nyc/f5266e5a7ce6402d3e53acdfaed8e2305116128e/resources/lambda-lists.hs | haskell | #LANGUAGE RankNTypes#
data [] a = [] | a : [a] deriving Show |
data Number a = Number (forall a. (a -> a) -> a -> a)
instance Num a => Show (Number a) where
show (Number f) = show $ f (1 +) 0
zero :: Number a
zero = Number (\f x -> x)
inc :: Number a -> Number a
inc (Number n) = Number (\f x -> f $ n f x)
one :: Number a
one = inc zero
two :: Number a
two = inc one
three ... |
402b39b210bc96a5ad5c6cd8cba7b2607e867b773b1e26c85dc05f515718b1d9 | elizabethsiegle/reddit-slack-bot | UsageTriggers.hs | # LANGUAGE MultiParamTypeClasses #
{-#LANGUAGE OverloadedStrings #-}
module Twilio.UsageTriggers
( -- * Resource
UsageTriggers(..)
, Twilio.UsageTriggers.get
) where
import Control.Applicative
import Control.Monad.Catch
import Data.Aeson
import Data.Maybe
import Control.Monad.Twilio
import Twilio.Internal... | null | https://raw.githubusercontent.com/elizabethsiegle/reddit-slack-bot/a52ab60dcaae8e16bee8cdba22fce627157a42d8/twilio-haskell-move-to-stack/src/Twilio/UsageTriggers.hs | haskell | #LANGUAGE OverloadedStrings #
* Resource | # LANGUAGE MultiParamTypeClasses #
module Twilio.UsageTriggers
UsageTriggers(..)
, Twilio.UsageTriggers.get
) where
import Control.Applicative
import Control.Monad.Catch
import Data.Aeson
import Data.Maybe
import Control.Monad.Twilio
import Twilio.Internal.Request
import Twilio.Internal.Resource as Resource... |
f5c8cc86758fb052a6c6bd2e51f5cb1c557492229e8d98ea70ebecffb052932b | mirage/ocaml-cohttp | cookie.mli | { { { Copyright ( C ) < 2012 > Anil Madhavapeddy < >
* Copyright ( C ) < 2009 > < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies... | null | https://raw.githubusercontent.com/mirage/ocaml-cohttp/524674e453c5eeb3be156e5046bc2fdaf5b50779/cohttp/src/cookie.mli | ocaml | * Instructs the user agent to discard the cookie unconditionally when the
user agent terminates.
* Lifetime of the cookie after which the user agent discards it
* A cookie is simply a key/value pair send from the client to the server
* A header which a server sends to a client to request that the client
... | { { { Copyright ( C ) < 2012 > Anil Madhavapeddy < >
* Copyright ( C ) < 2009 > < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies... |
85fffd7f45292a66876ebd58c6b3441dd11e4aa1b6b2fd58e0777362c7ae7699 | qkrgud55/ocamlmulti | frx_widget.ml | (***********************************************************************)
(* *)
MLTk , Tcl / Tk interface of OCaml
(* *)
, , and ... | null | https://raw.githubusercontent.com/qkrgud55/ocamlmulti/74fe84df0ce7be5ee03fb4ac0520fb3e9f4b6d1f/otherlibs/labltk/frx/frx_widget.ml | ocaml | *********************************************************************
described in file LICENSE found in the... | MLTk , Tcl / Tk interface of OCaml
, , and
projet Cristal , INRIA Rocquencourt
, Kyoto University RIMS
Copyright 2002 Institut National de Recherche en Informatique et
en Automatique and... |
3144b5eb699a97271ab31b1593626cbf0a508437a87ed950decec37f00ca05ab | GaloisInc/saw-script | Pretty.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE TypeOperators #
# LANGUAGE KindSignatures #
# LANGUAGE PolyKinds #
# LANGUAGE DataKinds #
# LANGUAGE RecordWildCards #
# LANGUAGE ViewPatterns #
module SAWScript.Heapster.Pretty where
import Text.PrettyPrint.ANSI.Leijen hiding ((<$>))
import qualified Text.PrettyPrint.ANSI.Leijen as ... | null | https://raw.githubusercontent.com/GaloisInc/saw-script/09463dd8dc3762c38ae0606c719619879421f894/heapster-saw/src/Verifier/SAW/Heapster/archival/Pretty.hs | haskell | # LANGUAGE GADTs #
| Typed string
| Try to make a string unique by adding a prime to the end
| Environment for pretty-printing
| Monad for pretty-printing
| Pretty-print inside a bigger context
| Typeclass for pretty-printing objects relative to a context
| Typeclass for pretty-printing objects relative to a con... | # LANGUAGE TypeOperators #
# LANGUAGE KindSignatures #
# LANGUAGE PolyKinds #
# LANGUAGE DataKinds #
# LANGUAGE RecordWildCards #
# LANGUAGE ViewPatterns #
module SAWScript.Heapster.Pretty where
import Text.PrettyPrint.ANSI.Leijen hiding ((<$>))
import qualified Text.PrettyPrint.ANSI.Leijen as PPL ((<$>),empty)
impor... |
5dfe19d29ca703b7eb64d741646f0638b48daa336e112ec1449b244b481026c5 | russmatney/org-crud | util.clj | (ns org-crud.util
(:require
[clojure.set :as set]))
(defn ns-select-keys
"Selects all keys from the provided `map` that match the given `ns-str`
Pulled from `wing.core`.
"
[ns-str map]
(into {} (filter (comp #{ns-str} namespace key)) map))
(defn ns-remove-keys
[ns-str map]
(into {} (remove (comp #... | null | https://raw.githubusercontent.com/russmatney/org-crud/11069d59925461601718c4bb4c29f74126093891/src/org_crud/util.clj | clojure |
get-all, get-one
x-v must exist for most predicates
if v is a function, treat it like a predicate
if v is a set, try set opts
otherwise, use v as comparison value
url parsing
merge maps
multi-group-by
| (ns org-crud.util
(:require
[clojure.set :as set]))
(defn ns-select-keys
"Selects all keys from the provided `map` that match the given `ns-str`
Pulled from `wing.core`.
"
[ns-str map]
(into {} (filter (comp #{ns-str} namespace key)) map))
(defn ns-remove-keys
[ns-str map]
(into {} (remove (comp #... |
1a7c43b17ea326090f00dd1af0790d921a0f25e98ed8e2d5a04f37983cd0cec2 | ygmpkk/house | Parse.hs | | A non - validating XML parser . For the input grammar , see
-- <-xml>.
module Text.XML.HaXml.Parse
(
* a whole document
xmlParse
* just a DTD
, dtdParse
) where
-- An XML parser, written using a slightly extended version of the
Hutton / Meijer parser combinators . The input is tokenised int... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/HaXml/src/Text/XML/HaXml/Parse.hs | haskell | <-xml>.
An XML parser, written using a slightly extended version of the
by the lexer xmlLex. Whilst parsing, we gather a symbol
expand their uses as we encounter them, forcing the remainder of the
later retrieval.
debugging only
#define DEBUG
(for error reports) and the string content of that file.
(fo... | | A non - validating XML parser . For the input grammar , see
module Text.XML.HaXml.Parse
(
* a whole document
xmlParse
* just a DTD
, dtdParse
) where
Hutton / Meijer parser combinators . The input is tokenised internally
table of entity references . must be defined before use , so we
i... |
ff676f999aa3dce13547c7a5fd3e4d9237a122b64a618ec92dd8d1605dc1144e | shayan-najd/NativeMetaprogramming | LocallyNameless.hs | module Unbound.Generics.LocallyNameless where
import Data.Typeable (Typeable)
data Name a = Name
class Alpha a where
isTerm :: a -> Bool
instance Typeable a => Alpha (Name a) where
isTerm _ = False
| null | https://raw.githubusercontent.com/shayan-najd/NativeMetaprogramming/24e5f85990642d3f0b0044be4327b8f52fce2ba3/testsuite/tests/typecheck/T11824/Unbound/Generics/LocallyNameless.hs | haskell | module Unbound.Generics.LocallyNameless where
import Data.Typeable (Typeable)
data Name a = Name
class Alpha a where
isTerm :: a -> Bool
instance Typeable a => Alpha (Name a) where
isTerm _ = False
| |
554672fa8fe1dbebd6a8bad66dfde7b8472b098867cf319823dac0765fc1c7fb | willijar/cl-data-format-validation | validation.lisp | ;; API definition and implementation of data validation for numerous data types.
Copyright ( C ) 2009 Dr.
Author : Dr. < >
;;; Copying:
;; This file is part of the DATA-FORMAT-VALIDATION Common Lisp library
;; This program is free software: you can redistribute it and/or modify
it under the terms of th... | null | https://raw.githubusercontent.com/willijar/cl-data-format-validation/95d44766e829582598f9dcdc5c23719c462d5bfb/validation.lisp | lisp | API definition and implementation of data validation for numerous data types.
Copying:
This file is part of the DATA-FORMAT-VALIDATION Common Lisp library
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied war... | Copyright ( C ) 2009 Dr.
Author : Dr. < >
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
DATA - FORMAT - VALIDATION is distributed in the hope that it will be useful ,
You should have received a copy of th... |
def649a926cad8a6279cd92da8515f27f3ccadd318adf2f5dd16dbd490001a44 | gafiatulin/codewars | StrangePrinc.hs | -- Strange principal
-- /
module Codewars.G964.StrangePrinc where
numOpenLockers :: Int -> Int
numOpenLockers n = floor . sqrt . fromIntegral
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/7%20kyu/StrangePrinc.hs | haskell | Strange principal
/ |
module Codewars.G964.StrangePrinc where
numOpenLockers :: Int -> Int
numOpenLockers n = floor . sqrt . fromIntegral
|
81c73e5eb71c011d7e9501aa193d7f696166024693098f7bffc03b17595eedad | alanz/ghc-exactprint | KindEqualities2.hs | # LANGUAGE DataKinds , GADTs , PolyKinds , TypeFamilies , ExplicitForAll ,
TemplateHaskell , UndecidableInstances , ScopedTypeVariables ,
TypeInType #
TemplateHaskell, UndecidableInstances, ScopedTypeVariables,
TypeInType #-}
module KindEqualities2 where
import ... | null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/pre-ghc86/KindEqualities2.hs | haskell | necessary because the following instances depend on the
previous ones. | # LANGUAGE DataKinds , GADTs , PolyKinds , TypeFamilies , ExplicitForAll ,
TemplateHaskell , UndecidableInstances , ScopedTypeVariables ,
TypeInType #
TemplateHaskell, UndecidableInstances, ScopedTypeVariables,
TypeInType #-}
module KindEqualities2 where
import ... |
daae6a2c1401e2122ffc09f40212727e8577ddb9a3d8c465616f1b3f9b8e07e8 | domdere/cassava-conduit | Conduit.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
-------------------------------------------------------------------
-- |
-- Module : Test.Data.Csv.Conduit
Copyright : ( C ) 2016
-- License : BSD-style (see the file etc/LICENSE.md)
Maintainer :
--
------------------------------------... | null | https://raw.githubusercontent.com/domdere/cassava-conduit/388eb42bbad256a79817fd955344ada8e3b1627b/quickcheck/Test/Data/Csv/Conduit.hs | haskell | -----------------------------------------------------------------
|
Module : Test.Data.Csv.Conduit
License : BSD-style (see the file etc/LICENSE.md)
----------------------------------------------------------------- | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
Copyright : ( C ) 2016
Maintainer :
module Test.Data.Csv.Conduit where
import Data.Csv.Conduit
import qualified Data.ByteString as BS
import Data.Csv (HasHeader(..), defaultDecodeOptions)
import Data.Conduit ((.|), runConduit)
import Data.Condu... |
6705ad1961d933289e8d9d598c51dea3e95a7b1b204bc4b6120731261b2b5abb | jordanthayer/ocaml-search | aepsilon.ml | * A epsilon , as Ghallab intended , implemented in our heuristic search
framework
framework *)
open Aseps (* has the exact same node structure. *)
(* Persevere strategies *)
let always_persevere _ _ = true
and never_persevere _ _ = false
and make_rand_persever p =
assert (p <= 1.);
Random.self_init();... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/search/aepsilon/aepsilon.ml | ocaml | has the exact same node structure.
Persevere strategies
Base callers
Callers integrated with persevere strategies | * A epsilon , as Ghallab intended , implemented in our heuristic search
framework
framework *)
let always_persevere _ _ = true
and never_persevere _ _ = false
and make_rand_persever p =
assert (p <= 1.);
Random.self_init();
(fun _ _ -> (Random.float 1.) < p)
and d_threshold_on_best dv =
Wheeler s... |
529693a8bf2eb0edbb7cecfb56bda87982a4c09c94035b3872f8f90036380b93 | colis-anr/colis-language | engine.ml | open Common
let indent s =
" > " ^ String.(concat "\n > " (split_on_char '\n' s))
let run_test filename : (unit, string) Result.result =
(* Load .meta file *)
begin
try
Ok (MetaFile.load_from_file
(Filename.concat !Options.directory ((Filename.remove_extension filename) ^ ".meta")))
... | null | https://raw.githubusercontent.com/colis-anr/colis-language/14b8087fa6323fb817d32c07236a2a084def01a1/tests/runner/engine.ml | ocaml | Load .meta file
Build command line
Execute process
Check stdout
Check stderr
Check return_code
scan directory
take only .sh files if --sh-only
run tests on them | open Common
let indent s =
" > " ^ String.(concat "\n > " (split_on_char '\n' s))
let run_test filename : (unit, string) Result.result =
begin
try
Ok (MetaFile.load_from_file
(Filename.concat !Options.directory ((Filename.remove_extension filename) ^ ".meta")))
with Sys_error _ -> Er... |
e4859c23f7d47b69b4402827576a3d2085b3bff1ef1c9720cd768374dcd065e6 | chrisdone/prana | CodePage.hs | # LANGUAGE Trustworthy #
# LANGUAGE CPP , BangPatterns , NoImplicitPrelude ,
NondecreasingIndentation , MagicHash #
NondecreasingIndentation, MagicHash #-}
module GHC.IO.Encoding.CodePage(
#if defined(mingw32_HOST_OS)
codePageEncoding, mkCodePageEncoding,
... | null | https://raw.githubusercontent.com/chrisdone/prana/f2e45538937d326aff562b6d49296eaedd015662/prana-boot/packages/base-4.11.1.0/GHC/IO/Encoding/CodePage.hs | haskell | Build ordering
also has this issue.
Since the Win32 package depends on base, we have to import these ourselves:
------------------------------------------
Array access functions
{-# INLINE lookupConv #-}
# INLINE lookupCompact # | # LANGUAGE Trustworthy #
# LANGUAGE CPP , BangPatterns , NoImplicitPrelude ,
NondecreasingIndentation , MagicHash #
NondecreasingIndentation, MagicHash #-}
module GHC.IO.Encoding.CodePage(
#if defined(mingw32_HOST_OS)
codePageEncoding, mkCodePageEncoding,
... |
d19296708ef6763dfef48da7a00871d0e3d96e863add69f97e3a936d3bb2b931 | DaMSL/K3 | Strings.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE ExistentialQuantification #
module Language.K3.Interpreter.Builtins.Strings where
import Language.K3.Core.Annotation
import Language.K3.Core.Common
import Language.K3.Core.Type
import Language.K3.Interpreter.Data.Types
import Language.K3.Interpreter.Data.Accessors
import Data.S... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/Interpreter/Builtins/Strings.hs | haskell | substring :: int -> string -> int
Constants --
Functions -- | # LANGUAGE DeriveGeneric #
# LANGUAGE ExistentialQuantification #
module Language.K3.Interpreter.Builtins.Strings where
import Language.K3.Core.Annotation
import Language.K3.Core.Common
import Language.K3.Core.Type
import Language.K3.Interpreter.Data.Types
import Language.K3.Interpreter.Data.Accessors
import Data.S... |
63eafded82e8202c8ff2696c96e99bbc75bf64adc9351f6718316733d4716758 | emqx/emqx-auth-http | emqx_auth_http_app.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 EMQ Technologies Co. , Ltd. 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 L... | null | https://raw.githubusercontent.com/emqx/emqx-auth-http/40da87f9aa21600ba576f50f3ce0f87655a16b59/src/emqx_auth_http_app.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 ... | Copyright ( c ) 2020 EMQ Technologies Co. , Ltd. 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(emqx_auth_http_app).
-behaviour(application).
-emqx_plugin(auth).
-include("emqx_auth_http.h... |
8121337139c57442b3eca9a8c7db07b63910bdaae07843063576fcc2f5fe1158 | xmonad/xmonad-contrib | SpawnOnce.hs | -----------------------------------------------------------------------------
-- |
-- Module : XMonad.Util.SpawnOnce
-- Description : A module for spawning a command once, and only once.
Copyright : ( c ) 2009
-- License : BSD3-style (see LICENSE)
--
-- Maintainer :
-- Stability : unstable
--... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/e0d1f177ea6c620b7612e431ff01b3ca1a62c829/XMonad/Util/SpawnOnce.hs | haskell | ---------------------------------------------------------------------------
|
Module : XMonad.Util.SpawnOnce
Description : A module for spawning a command once, and only once.
License : BSD3-style (see LICENSE)
Maintainer :
Stability : unstable
Portability : not portable
A module for spawni... | Copyright : ( c ) 2009
" XMonad . Util . SessionStart " for a different and more flexible way to
run commands only on first startup .
module XMonad.Util.SpawnOnce (spawnOnce,
manageSpawn,
spawnOnOnce,
spawnNOnOnce,
... |
0f78dc716e9638be75b7298cdd8ebdaa32d5cb27cdf85f1775bbb91eec125c0c | Yuras/pdf-toolbox | FlateDecode.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE PatternGuards #
-- | Flate decode filter
module Pdf.Core.Stream.Filter.FlateDecode
(
flateDecode
)
where
import Data.Word
import Data.ByteString (ByteString)
import qualified Data.ByteString as ByteString
import qualified Data.HashMap.S... | null | https://raw.githubusercontent.com/Yuras/pdf-toolbox/f1d20479fe6782bc293468ac05186e658216388b/core/lib/Pdf/Core/Stream/Filter/FlateDecode.hs | haskell | # LANGUAGE OverloadedStrings #
| Flate decode filter
| Vary basic implementation. Only PNG-UP prediction is implemented
TODO: Hacky solution, rewrite it | # LANGUAGE ScopedTypeVariables #
# LANGUAGE PatternGuards #
module Pdf.Core.Stream.Filter.FlateDecode
(
flateDecode
)
where
import Data.Word
import Data.ByteString (ByteString)
import qualified Data.ByteString as ByteString
import qualified Data.HashMap.Strict as HashMap
import Control.Exception hiding (throw)
imp... |
ac6f8ac36977beeb3eba8f53a01e8d054fae3772f93ae79e1c8740855fba5989 | BitGameEN/bitgamex | usr_gold_transfer.erl | %%%--------------------------------------------------------
%%% @Module: usr_gold_transfer
%%% @Description: 自动生成
%%%--------------------------------------------------------
-module(usr_gold_transfer).
-export([get_one/1, get_gold_transfer_gids_by_wallet_addr/1, get_gold_transfer_gids_by_update_time/1, get_gold_transfe... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/data/usr_gold_transfer.erl | erlang | --------------------------------------------------------
@Module: usr_gold_transfer
@Description: 自动生成
-------------------------------------------------------- | -module(usr_gold_transfer).
-export([get_one/1, get_gold_transfer_gids_by_wallet_addr/1, get_gold_transfer_gids_by_update_time/1, get_gold_transfer_gids_by_type/1, get_gold_transfer_gids_by_transaction_id_and_transaction_type/1, get_gold_transfer_gids_by_status/1, get_gold_transfer_gids_by_player_id/1, set_one/1, set_f... |
c70cbc5ccf1fd086901d5364269b9b92c33d5e88506bf2e3faf2b4c00939b9c4 | goblint/analyzer | resultQuery.ml | open Analyses
module Query (SpecSys: SpecSys) =
struct
open SpecSys
let ask_local (gh: EQSys.G.t GHT.t) (lvar:EQSys.LVar.t) local =
(* build a ctx for using the query system *)
let rec ctx =
{ ask = (fun (type a) (q: a Queries.t) -> Spec.query ctx q)
; emit = (fun _ -> failwith "Cannot \"... | null | https://raw.githubusercontent.com/goblint/analyzer/4828e7b40860c84ce5b9fe072cf484202805dff4/src/framework/resultQuery.ml | ocaml | build a ctx for using the query system
build a ctx for using the query system
TODO: how can be missing?
build a ctx for using the query system
TODO maybe ask should take a node (which could be used here) instead of a location
TODO: how can be missing? | open Analyses
module Query (SpecSys: SpecSys) =
struct
open SpecSys
let ask_local (gh: EQSys.G.t GHT.t) (lvar:EQSys.LVar.t) local =
let rec ctx =
{ ask = (fun (type a) (q: a Queries.t) -> Spec.query ctx q)
; emit = (fun _ -> failwith "Cannot \"emit\" in witness context.")
; node = fst... |
f308fa04a550bccf25f675b46b9910a5e321e19038f8c77caa940cf70002da8f | bmeurer/ocaml-experimental | odoc_dag2html.mli | (***********************************************************************)
(* OCamldoc *)
(* *)
, projet Cristal , INRIA Rocquencourt
(* ... | null | https://raw.githubusercontent.com/bmeurer/ocaml-experimental/fe5c10cdb0499e43af4b08f35a3248e5c1a8b541/ocamldoc/odoc_dag2html.mli | ocaml | *********************************************************************
OCamldoc
... | , projet Cristal , INRIA Rocquencourt
Copyright 2001 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$
* The types and functions to crea... |
030c75385e67543687e5f568706394a471fc2432e4a152af3b9159f16f969211 | SchornacklabSLCU/amfinder | uIHelper.mli | AMFinder - ui / uIHelper.mli
*
* MIT License
* Copyright ( c ) 2021
*
* Permission is hereby granted , free of charge , to any person obtaining a copy
* of this software and associated documentation files ( the " Software " ) , to
* deal in the Software without restriction , including without l... | null | https://raw.githubusercontent.com/SchornacklabSLCU/amfinder/8790fdbaf324e20dfa794d3f5caf6597292741fe/amfbrowser/sources/ui/uIHelper.mli | ocaml | * Helper functions for custom toolbars.
* Adds a separator (and some extra space).
* Adds more space.
* Pango small text | AMFinder - ui / uIHelper.mli
*
* MIT License
* Copyright ( c ) 2021
*
* Permission is hereby granted , free of charge , to any person obtaining a copy
* of this software and associated documentation files ( the " Software " ) , to
* deal in the Software without restriction , including without l... |
a0d1cd23f8fbb2cb0f3ba9d7633f4c47c254bb54990accc5ad76f32ed14349d1 | Enecuum/Node | Language.hs | module Enecuum.Framework.Language
( module X
)
where
import Enecuum.Framework.NodeDefinition.Language as X
import Enecuum.Framework.Networking.Language as X
import Enecuum.Framework.Node.Language as X
import Enecuum.Framework.Handler.Rpc.Language as X
import Enecuu... | null | https://raw.githubusercontent.com/Enecuum/Node/3dfbc6a39c84bd45dd5f4b881e067044dde0153a/src/Enecuum/Framework/Language.hs | haskell | module Enecuum.Framework.Language
( module X
)
where
import Enecuum.Framework.NodeDefinition.Language as X
import Enecuum.Framework.Networking.Language as X
import Enecuum.Framework.Node.Language as X
import Enecuum.Framework.Handler.Rpc.Language as X
import Enecuu... | |
3a195764f2edfcce731dcecb28021d84f60cab1619989a085c6370b76ab273c0 | datalogisk-fagraad/DIKUNotes | the_diamond_path.erl | -module(the_diamond_path).
-export([a_love_story/0]).
a_love_story() ->
% Defining a dimond-shaped territory.
{ok, A} = district:create("A"),
{ok, B} = district:create("B"),
{ok, C} = district:create("C"),
{ok, D} = district:create("D"),
district:connect(A, b, B),
district:connect(A, c, C),
district:co... | null | https://raw.githubusercontent.com/datalogisk-fagraad/DIKUNotes/fb0487d62599e37bf94da4dab3f63728e0c4c4c8/Advanced%20Programming%20(AP)/2018%20Exam%20and%20Solution/handin/ravnica/the_diamond_path.erl | erlang | Defining a dimond-shaped territory.
Activating the districts.
Since there is a path from A to every other district, this will suffice:
But fortunately, there is no way to get lost in the diamond path.
<------------- | changed in ver. 1.0.1 |
THE END | -module(the_diamond_path).
-export([a_love_story/0]).
a_love_story() ->
{ok, A} = district:create("A"),
{ok, B} = district:create("B"),
{ok, C} = district:create("C"),
{ok, D} = district:create("D"),
district:connect(A, b, B),
district:connect(A, c, C),
district:connect(B, d, D),
district:connect(C, d,... |
4c4e51b7af67f4743261c3dbeab6f7c1b84a50d7acfbc906417d9bbc791baa3d | michalkonecny/aern2 | Box.hs | # OPTIONS_GHC -Wno - orphans #
module AERN2.BoxFun.Box where
import qualified Prelude as Prelude
import MixedTypesNumPrelude
import AERN2.MP.Dyadic
import AERN2.MP.Ball
import AERN2.Linear.Vector.Type (Vector, (!))
import qualified AERN2.Linear.Vector.Type as V
import AERN2.Util.Util
type Box = Vector (CN MPBall)
... | null | https://raw.githubusercontent.com/michalkonecny/aern2/025005773f075280b89d8467b78cd74cb4e40cd5/aern2-mfun/src/AERN2/BoxFun/Box.hs | haskell | intersection :: Box -> Box -> Maybe Box
intersection = undefined
TODO: unsafe
y is the dimension bisected in the current iteration
x is a bisection of the previous dimension (tail recursion) | # OPTIONS_GHC -Wno - orphans #
module AERN2.BoxFun.Box where
import qualified Prelude as Prelude
import MixedTypesNumPrelude
import AERN2.MP.Dyadic
import AERN2.MP.Ball
import AERN2.Linear.Vector.Type (Vector, (!))
import qualified AERN2.Linear.Vector.Type as V
import AERN2.Util.Util
type Box = Vector (CN MPBall)
... |
4b7a41db59cd69fe7543bab744fd20d7278f51adad50afc845c61b508a5ce742 | janestreet/core | span_float.mli | open! Import
include Span_intf.S with type underlying = float
module Stable : sig
(** [V1]'s sexps use single-unit format and support units from [d] to [ms]; it does not
support [us] or [ns]. [V1]'s sexp conversions do not round-trip precisely. *)
module V1 : sig
type nonrec t = t
[@@deriving sexp, ... | null | https://raw.githubusercontent.com/janestreet/core/4b6635d206f7adcfac8324820d246299d6f572fe/core/src/span_float.mli | ocaml | * [V1]'s sexps use single-unit format and support units from [d] to [ms]; it does not
support [us] or [ns]. [V1]'s sexp conversions do not round-trip precisely.
* [V2]'s sexps use single-unit format and support units from [d] to [ns]. [V2] can
read [V1] sexps but not vice versa. [V2]'s sexp conversions do ... | open! Import
include Span_intf.S with type underlying = float
module Stable : sig
module V1 : sig
type nonrec t = t
[@@deriving sexp, sexp_grammar, bin_io, compare, hash, equal, stable_witness]
end
module V2 : sig
type nonrec t = t
[@@deriving sexp, sexp_grammar, bin_io, compare, hash, equal, s... |
a0fff96eea9354aaded7264f6edaf88c796d197ee5709d3100fc912e72a727ea | input-output-hk/project-icarus-importer | Base.hs | -- | Block constructors and basic functions.
module Pos.Block.Base
( mkMainBlockExplicit
, mkMainBlock
, mkMainHeaderExplicit
, mkMainHeader
, emptyMainBody
, mkGenesisHeader
, mkGenesisBlock
, genesisBlock0
) where
import Universum
import ... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/block/src/Pos/Block/Base.hs | haskell | | Block constructors and basic functions.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
| Smart constructor for 'MainBlockHeader'.
| Make a 'MainBlockHeader' for a given slot, with a given body, parent hash,
and ... |
module Pos.Block.Base
( mkMainBlockExplicit
, mkMainBlock
, mkMainHeaderExplicit
, mkMainHeader
, emptyMainBody
, mkGenesisHeader
, mkGenesisBlock
, genesisBlock0
) where
import Universum
import Data.Default (Default (def))
import ... |
812f77ca0322e520dd385bfd82fcaefb963361276bc1663596973bb765b57828 | mokus0/junkbox | ToString.hs |
- ` ` Data / ToString ''
- ( c ) 2008 , , Inc.
- ``Data/ToString''
- (c) 2008 Cook, J. MR SSD, Inc.
-}
# LANGUAGE
MultiParamTypeClasses ,
FlexibleInstances ,
UndecidableInstances ,
OverlappingInstances
#
MultiParamTypeClasses,
... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Idioms%2C%20%26c./Data/ToString.hs | haskell |
- ` ` Data / ToString ''
- ( c ) 2008 , , Inc.
- ``Data/ToString''
- (c) 2008 Cook, J. MR SSD, Inc.
-}
# LANGUAGE
MultiParamTypeClasses ,
FlexibleInstances ,
UndecidableInstances ,
OverlappingInstances
#
MultiParamTypeClasses,
... | |
4069119fa7e2e907cfddc7a3e8c5abacefaf2d83401d7e3c86f9c5dab1de8647 | kazu-yamamoto/http2 | Table.hs | {-# OPTIONS_HADDOCK hide #-}
module Network.HPACK.Table (
-- * dynamic table
DynamicTable
, newDynamicTableForEncoding
, newDynamicTableForDecoding
, withDynamicTableForEncoding
, withDynamicTableForDecoding
, huffmanDecoder
, renewDynamicTable
, printDynamicTable
, isDynamicTableEmpty
, isSuit... | null | https://raw.githubusercontent.com/kazu-yamamoto/http2/3c29763be147a3d482eff28f427ad80f1d4df706/Network/HPACK/Table.hs | haskell | # OPTIONS_HADDOCK hide #
* dynamic table
* Insertion
* Entry
* Reverse index
* Index to entry |
module Network.HPACK.Table (
DynamicTable
, newDynamicTableForEncoding
, newDynamicTableForDecoding
, withDynamicTableForEncoding
, withDynamicTableForDecoding
, huffmanDecoder
, renewDynamicTable
, printDynamicTable
, isDynamicTableEmpty
, isSuitableSize
, TableSizeAction(..)
, needChangeTab... |
620d23ea6ef1aa024d6cd4b76ec7c00c7728eb21e75f41802524cea54247399a | cedlemo/OCaml-GI-ctypes-bindings-generator | Page_range.mli | open Ctypes
type t
val t_typ : t structure typ
val f_start: (int32, t structure) field
val f_end: (int32, t structure) field
| null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Page_range.mli | ocaml | open Ctypes
type t
val t_typ : t structure typ
val f_start: (int32, t structure) field
val f_end: (int32, t structure) field
| |
c49a1b3cfb12314c41af384d798e5b0baa2f0f8095a5aaf3fa82d28a2a719efe | pfdietz/ansi-test | compiled-function-p.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Mon Jan 13 16:32:44 2003
;;;; Contains: Tests of COMPILED-FUNCTION-P
(deftest compiled-function-p.1
(check-type-predicate #'compiled-function-p 'compiled-function)
nil)
(deftest compiled-function-p.2
(compiled-function-p '(lambda (x y) (cons y x)))
nil)
... | null | https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/data-and-control-flow/compiled-function-p.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of COMPILED-FUNCTION-P | Author :
Created : Mon Jan 13 16:32:44 2003
(deftest compiled-function-p.1
(check-type-predicate #'compiled-function-p 'compiled-function)
nil)
(deftest compiled-function-p.2
(compiled-function-p '(lambda (x y) (cons y x)))
nil)
(deftest compiled-function-p.3
(notnot-mv (compiled-function-p (c... |
c5fe26cdbd5f31280a819be3a6aaa7ce9565a6336d2a439181ae357387ec074b | mzp/scheme-abc | cmdOpt.mli | type scm = {
scm_cmd : string;
includes : string;
link_std:bool
}
type link = {
link_cmd : string;
size : int * int;
bg_color : Color.t;
libs : string list;
use_network: bool
}
type general = {
verbose : bool;
just_print: bool;
keep_files: bool;
}
type t = {
inputs : string list;
output : s... | null | https://raw.githubusercontent.com/mzp/scheme-abc/2cb541159bcc32ae4d033793dea6e6828566d503/driver/cmdOpt.mli | ocaml | type scm = {
scm_cmd : string;
includes : string;
link_std:bool
}
type link = {
link_cmd : string;
size : int * int;
bg_color : Color.t;
libs : string list;
use_network: bool
}
type general = {
verbose : bool;
just_print: bool;
keep_files: bool;
}
type t = {
inputs : string list;
output : s... | |
66d2cdc85825d9cce00946bc1e029d738ed058fc6b93719831e8c2c0c1e7ee90 | decomplect/ion | lindenmayer_systems.cljc | (ns ion.ergo.lindenmayer-systems
"Support for Lindenmayer systems: deterministic, stochastic, context-free,
context-sensitive, or parametric. Or combinations thereof.
TL;DR: How to produce recursive axiomatic transducible sequences (RATS)
A somewhat confusing variety of terms are used to describe L-systems... | null | https://raw.githubusercontent.com/decomplect/ion/72e7a9b9359112832c928017d307a71317b84802/examples/ion/ergo/lindenmayer_systems.cljc | clojure | DR: How to produce recursive axiomatic transducible sequences (RATS)
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Helper Functions
--------------------------------------------------------------------------... | (ns ion.ergo.lindenmayer-systems
"Support for Lindenmayer systems: deterministic, stochastic, context-free,
context-sensitive, or parametric. Or combinations thereof.
A somewhat confusing variety of terms are used to describe L-systems and
their component parts, and this source code file is likely no excep... |
aef7ef6739452f75e20b7c7134b338af4d2df6e15b228bab4d6e46cc493ca925 | joshuamiller/map-todo-demo | events.cljs | (ns map-todo-demo.events
(:require
[re-frame.core :refer [reg-event-db after]]
[clojure.spec.alpha :as s]
[map-todo-demo.db :as db :refer [app-db]]))
;; -- Interceptors ------------------------------------------------------------
;;
;; See -frame/blob/master/docs/Interceptors.md
;;
(defn check-and-throw
"... | null | https://raw.githubusercontent.com/joshuamiller/map-todo-demo/24cfc555357401f079b709891f2d53272f88b5b2/src/map_todo_demo/events.cljs | clojure | -- Interceptors ------------------------------------------------------------
See -frame/blob/master/docs/Interceptors.md
-- Handlers -------------------------------------------------------------- | (ns map-todo-demo.events
(:require
[re-frame.core :refer [reg-event-db after]]
[clojure.spec.alpha :as s]
[map-todo-demo.db :as db :refer [app-db]]))
(defn check-and-throw
"Throw an exception if db doesn't have a valid spec."
[spec db [event]]
(when-not (s/valid? spec db)
(let [explain-data (s/exp... |
e7e34d401ecf28124f074c16d0e18e44d048112cb7859cc1e2f124a970bb2eb9 | kyleburton/sandbox | do_something.clj | (ns single-page-app.api.v1.do-something
[:require
[clojure.tools.logging :as log]
[clojure.data.json :as json]])
(defonce stats (atom {}))
(defn response-body [m]
(let [resp-time (java.util.Date.)]
(->
m
(assoc
:stats @stats
:time (str resp-time)
:time_ms... | null | https://raw.githubusercontent.com/kyleburton/sandbox/cccbcc9a97026336691063a0a7eb59293a35c31a/examples/http-kit-single-page-app/src/single_page_app/api/v1/do_something.clj | clojure | (ns single-page-app.api.v1.do-something
[:require
[clojure.tools.logging :as log]
[clojure.data.json :as json]])
(defonce stats (atom {}))
(defn response-body [m]
(let [resp-time (java.util.Date.)]
(->
m
(assoc
:stats @stats
:time (str resp-time)
:time_ms... | |
4206e82f8dece3b2b846ceec1cb20233976c872a8ce04764af3e8540f2da079d | acl2/acl2 | structs.lisp | C Library
;
Copyright ( C ) 2022 Kestrel Institute ( )
Copyright ( C ) 2022 Kestrel Technology LLC ( )
;
License : A 3 - clause BSD license . See the LICENSE file distributed with ACL2 .
;
Author : ( )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package "ACL2")
... | null | https://raw.githubusercontent.com/acl2/acl2/1e94e0bfb92e8caa9e90d9d5fe6afbed655bf8db/books/kestrel/c/atc/tests/structs.lisp | lisp |
reuse these DEFSTRUCTs
Some examples to test code generation for structuress.
Read members from structures.
Return structures unchanged, by value and by pointer.
Write members to structures.
| C Library
Copyright ( C ) 2022 Kestrel Institute ( )
Copyright ( C ) 2022 Kestrel Technology LLC ( )
License : A 3 - clause BSD license . See the LICENSE file distributed with ACL2 .
Author : ( )
(in-package "ACL2")
(include-book "kestrel/c/atc/atc" :dir :system :ttags ((:quicklisp) (:quicklisp.osicat... |
cfc8baecda6c1cc026e29e9a6d7419087aa98833cc59c92c2ed779a42c20948c | parof/wstat | DomainsList.hs | module Domains.DomainsList where
simpleSign = "ss"
sign = "s"
interval = "i"
congruence = "c"
reductionIntervalCongruence = "ric"
listAllDomains =
simpleSign ++ ", " ++
sign ++ ", " ++
interval ++ ", " ++
congruence ++ ", " ++
reductionIntervalCongruence | null | https://raw.githubusercontent.com/parof/wstat/369cf5d1d92ef235049c29ad2f1cc6fd53747754/src/Domains/DomainsList.hs | haskell | module Domains.DomainsList where
simpleSign = "ss"
sign = "s"
interval = "i"
congruence = "c"
reductionIntervalCongruence = "ric"
listAllDomains =
simpleSign ++ ", " ++
sign ++ ", " ++
interval ++ ", " ++
congruence ++ ", " ++
reductionIntervalCongruence | |
df4b4fb6a208910677e7cbb01ce858262e9adfa487760db66e898b5652610e00 | samoht/camloo | module.scm | * Copyright ( C ) 1994 - 2010 INRIA
;*
;* 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 Foundation ; version 2 of the License .
;*
;* This program is distributed in the hope that it will be useful,
;* but W... | null | https://raw.githubusercontent.com/samoht/camloo/29a578a152fa23a3125a2a5b23e325b6d45d3abd/src/camloo/Llib/module.scm | scheme | *
* This program is free software; you can redistribute it and/or modify
version 2 of the License .
*
* 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. See the
* GNU General Public L... | * Copyright ( C ) 1994 - 2010 INRIA
* it under the terms of the GNU General Public License as published by
(module module
(include "var.sch")
(import init
var
lib_module_list)
(export (get-imported-modules)
(module-shape module)
(remember-module! module . name)
(mark... |
20028f208f243d17e1c081fdd0051c27bd90c35c29bfe29fe9b9cc77499a298a | anoma/juvix | All.hs | module Juvix.Data.Keyword.All
( module Juvix.Data.Keyword,
module Juvix.Data.Keyword.All,
)
where
import Juvix.Data.Keyword
import Juvix.Extra.Strings qualified as Str
kwBuiltin :: Keyword
kwBuiltin = asciiKw Str.builtin
kwAny :: Keyword
kwAny = asciiKw Str.any
kwAssign :: Keyword
kwAssign = asciiKw Str.ass... | null | https://raw.githubusercontent.com/anoma/juvix/fab40c6c9932cc12592fbacc54fac1ddcd3b2228/src/Juvix/Data/Keyword/All.hs | haskell | module Juvix.Data.Keyword.All
( module Juvix.Data.Keyword,
module Juvix.Data.Keyword.All,
)
where
import Juvix.Data.Keyword
import Juvix.Extra.Strings qualified as Str
kwBuiltin :: Keyword
kwBuiltin = asciiKw Str.builtin
kwAny :: Keyword
kwAny = asciiKw Str.any
kwAssign :: Keyword
kwAssign = asciiKw Str.ass... | |
8747311665c6b8ce57e60ff4540c7f2089ab01aecc01e330e26e3b1a79cc5254 | ocaml/dune | map.ml | module type S = Map_intf.S
module type Key = Map_intf.Key
module Make (Key : Key) : S with type key = Key.t = struct
include MoreLabels.Map.Make (struct
type t = Key.t
let compare a b = Ordering.to_int (Key.compare a b)
end)
let find key t = find_opt t key
let mem t k = mem k t
let set t k v = a... | null | https://raw.githubusercontent.com/ocaml/dune/714626f4d408e5c71c24ba91d0d520588702ec52/otherlibs/stdune/src/map.ml | ocaml | module type S = Map_intf.S
module type Key = Map_intf.Key
module Make (Key : Key) : S with type key = Key.t = struct
include MoreLabels.Map.Make (struct
type t = Key.t
let compare a b = Ordering.to_int (Key.compare a b)
end)
let find key t = find_opt t key
let mem t k = mem k t
let set t k v = a... | |
4790d19a2a8195bd7f94020b4c5a57fe4edb2dc29940725ec2414b9386912736 | ananthakumaran/eopl | vector_ref.clj | (ns eopl.core.vector-ref
(:use clojure.test))
(def empty-store [])
(def store (atom :undefined))
(defn initialize-store! []
(reset! store empty-store))
(def reference? number?)
(defn newref [val]
(let [next-ref (count @store)]
(swap! store conj val)
next-ref))
(defn de-ref [ref]
(nth @store ref))
... | null | https://raw.githubusercontent.com/ananthakumaran/eopl/876d6c2e44865e2c89a05a683d99a289c71f1487/src/eopl/core/vector_ref.clj | clojure | (ns eopl.core.vector-ref
(:use clojure.test))
(def empty-store [])
(def store (atom :undefined))
(defn initialize-store! []
(reset! store empty-store))
(def reference? number?)
(defn newref [val]
(let [next-ref (count @store)]
(swap! store conj val)
next-ref))
(defn de-ref [ref]
(nth @store ref))
... | |
8bc271abbcf2c360f95aa149f41ff7d9932455243be0f69d9f13a851c9c11d76 | tweag/pirouette | Inline.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
module Pirouette.Transformations.Inline where
import Data.Generics.Uniplate.Operations
import qualified Data.Map as Map
import Pirouette.Term.Syntax
import qualified Pirouette.Term.Syntax.SystemF as SystF
import Pirouette.Trans... | null | https://raw.githubusercontent.com/tweag/pirouette/c511a1680f17e053b0d60aba51d30462501c3a0c/src/Pirouette/Transformations/Inline.hs | haskell | # LANGUAGE RankNTypes # | # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
module Pirouette.Transformations.Inline where
import Data.Generics.Uniplate.Operations
import qualified Data.Map as Map
import Pirouette.Term.Syntax
import qualified Pirouette.Term.Syntax.SystemF as SystF
import Pirouette.Transformations.Term
expandDefsI... |
78f077dbf5d5868044686e51f4f6406696365c33003534e1da601da1df718c5c | rizo/snowflake-os | translcore.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/plugins/ocamlopt.opt/bytecomp/translcore.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ Id$
open Misc
open Asttypes
open ... |
33bb49d9e8700bf6e03c559b26bc550e8fee28deefe1af52c1e8821857959e3e | exoscale/clojure-kubernetes-client | v1beta1_subject_rules_review_status.clj | (ns clojure-kubernetes-client.specs.v1beta1-subject-rules-review-status
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1beta1-non-resource-rule :refer :all]
[clojure-kubernetes-client.specs.v1beta1-resource-rule :refer :all]
... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1beta1_subject_rules_review_status.clj | clojure | (ns clojure-kubernetes-client.specs.v1beta1-subject-rules-review-status
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1beta1-non-resource-rule :refer :all]
[clojure-kubernetes-client.specs.v1beta1-resource-rule :refer :all]
... | |
42799deee4828a3a46a032f04dffcef9dba944ddfdd0225d842ecde5cc71a818 | crategus/cl-cffi-gtk | rtest-gtk-radio-button.lisp | (def-suite gtk-radio-button :in gtk-suite)
(in-suite gtk-radio-button)
;;; --- Types and Values -------------------------------------------------------
;;; GtkRadioButton
(test gtk-radio-button-class
;; Type check
(is (g-type-is-object "GtkRadioButton"))
;; Check the registered name
(is (eq 'gtk-radio-bu... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/7f5a09f78d8004a71efa82794265f2587fff98ab/test/rtest-gtk-radio-button.lisp | lisp | --- Types and Values -------------------------------------------------------
GtkRadioButton
Type check
Check the registered name
Check the type initializer
Check the parent
Check the children
Check the interfaces
Check the class properties
Get the names of the style properties.
Get the names of the child... | (def-suite gtk-radio-button :in gtk-suite)
(in-suite gtk-radio-button)
(test gtk-radio-button-class
(is (g-type-is-object "GtkRadioButton"))
(is (eq 'gtk-radio-button
(registered-object-type-by-name "GtkRadioButton")))
(is (eq (gtype "GtkRadioButton")
(gtype (foreign-funcall "gtk_radio_butt... |
75464961d638c50e8ba8f523e02b47523acb61698f90ea82d5f41f4e651b54c2 | owlbarn/owl_mask_rcnn | pyramidROIAlign.ml | open Owl
module N = Dense.Ndarray.S
module C = Configuration
(* *** ROIAlign Layer ***
* Resizes all regions of interest from feature maps to a fixed size. *)
pool_shape : ( pool_height , pool_width ) of the output pool regions .
* Returns : Pooled regions with shape
* [ batch_size , num_boxes , , pool_wi... | null | https://raw.githubusercontent.com/owlbarn/owl_mask_rcnn/838d921401676271f96e867452e21b829aff29ec/src/mrcnn/pyramidROIAlign.ml | ocaml | *** ROIAlign Layer ***
* Resizes all regions of interest from feature maps to a fixed size.
[batch, N, [y1, x1, y2, x2]]
[batch, (image data)]
Different levels of feature maps from the backbone network.
*** Stop gradient computation here if training the network ***
Rearranges pooled in the original order. | open Owl
module N = Dense.Ndarray.S
module C = Configuration
pool_shape : ( pool_height , pool_width ) of the output pool regions .
* Returns : Pooled regions with shape
* [ batch_size , num_boxes , , pool_width , channels ] .
* Returns: Pooled regions with shape
* [batch_size, num_boxes, pool_height, po... |
d6aaf1fd1275eebf0f83cd272715e11731e9e322e5f9593105b5d1714d5d0ac1 | broadinstitute/firecloud-ui | filter.cljs | (ns broadfcui.common.filter
(:require
[broadfcui.common.flex-utils :as flex]
[broadfcui.common.links :as links]
[broadfcui.common.style :as style]
[broadfcui.utils :as utils]
))
(defn area [attributes & sections]
[:div (utils/deep-merge {:style {:fontSize "85%" :padding "1rem"
... | null | https://raw.githubusercontent.com/broadinstitute/firecloud-ui/8eb077bc137ead105db5665a8fa47a7523145633/src/cljs/main/broadfcui/common/filter.cljs | clojure | (ns broadfcui.common.filter
(:require
[broadfcui.common.flex-utils :as flex]
[broadfcui.common.links :as links]
[broadfcui.common.style :as style]
[broadfcui.utils :as utils]
))
(defn area [attributes & sections]
[:div (utils/deep-merge {:style {:fontSize "85%" :padding "1rem"
... | |
d023fdfca05403cf3d904322bcd6e665d65b18fa2473643c5c7e1d2d66396d69 | ocsigen/js_of_ocaml | dump_sourcemap.ml | open Js_of_ocaml_compiler
open Stdlib
let normalize_path s =
let s =
String.map
~f:(function
| '\\' -> '/' (* Normalize windows path for the tests *)
| x -> x)
s
in
Filename.basename s
let input_lines file =
let rec loop acc ic =
match input_line ic with
| line -> loop ... | null | https://raw.githubusercontent.com/ocsigen/js_of_ocaml/3b2b311d767bf4542aefe09fc865b28b5cd0ee00/compiler/tests-sourcemap/dump_sourcemap.ml | ocaml | Normalize windows path for the tests | open Js_of_ocaml_compiler
open Stdlib
let normalize_path s =
let s =
String.map
~f:(function
| x -> x)
s
in
Filename.basename s
let input_lines file =
let rec loop acc ic =
match input_line ic with
| line -> loop (line :: acc) ic
| exception End_of_file -> List.rev acc
in... |
c4e4b02f252e356dbe9038aa5f9a76761162581dff94990c7b56a8c15b1b682f | plow-technologies/yesod-routes-metrics | Main.hs | module Main where
import Yesod.Routes.Convert
import Yesod.Routes.Util
--convertResourceTreesToRouteNames
--, convertRequestToRouteName
--, resourcesFromString
main :: IO ()
main = do
f <- readFile "config/routes"
let resources = resourcesFromString f
putStrLn ""
putStrLn "config/routes ResourceTrees:"
mapM... | null | https://raw.githubusercontent.com/plow-technologies/yesod-routes-metrics/a499200b21d023f30238822c274e2f27c4dec1be/examples/print-routes/app/Main.hs | haskell | convertResourceTreesToRouteNames
, convertRequestToRouteName
, resourcesFromString | module Main where
import Yesod.Routes.Convert
import Yesod.Routes.Util
main :: IO ()
main = do
f <- readFile "config/routes"
let resources = resourcesFromString f
putStrLn ""
putStrLn "config/routes ResourceTrees:"
mapM_ (putStrLn . showResourceTree) resources
putStrLn ""
putStrLn "config/routes route n... |
de1db6ac6004d75f526956d66397be9257808106a89493a10d4c04c405f38820 | scrintal/heroicons-reagent | shield_check.cljs | (ns com.scrintal.heroicons.outline.shield-check)
(defn render []
[:svg {:xmlns ""
:fill "none"
:viewBox "0 0 24 24"
:strokeWidth "1.5"
:stroke "currentColor"
:aria-hidden "true"}
[:path {:strokeLinecap "round"
:strokeLinejoin "round"
... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/outline/shield_check.cljs | clojure | (ns com.scrintal.heroicons.outline.shield-check)
(defn render []
[:svg {:xmlns ""
:fill "none"
:viewBox "0 0 24 24"
:strokeWidth "1.5"
:stroke "currentColor"
:aria-hidden "true"}
[:path {:strokeLinecap "round"
:strokeLinejoin "round"
... | |
31553a061e8010e2d264a7aa3056f64612c57d3ec5113d1a42d5315c2565d27e | Andromedans/andromeda | eval.ml | (** Evaluation of computations *)
(** Notation for the monadic bind *)
let (>>=) = Runtime.bind
let return = Runtime.return
(** Conversion of runtime values to more specific values *)
let as_atom ~at v =
Runtime.lookup_signature >>= fun sgn ->
let j = Runtime.as_is_term ~at v in
match Nucleus.invert_is_term sg... | null | https://raw.githubusercontent.com/Andromedans/andromeda/761b0fd07cab5cbcf68a06e79b7f27301826ca82/src/runtime/eval.ml | ocaml | * Evaluation of computations
* Notation for the monadic bind
* Conversion of runtime values to more specific values
* Main evaluation loop.
* Evaluate a computation.
* Coerce the value [v] to the given judgement boundary [bdry]
* Compute a judgement with the given abstracted boundary
These have no use for the b... |
let (>>=) = Runtime.bind
let return = Runtime.return
let as_atom ~at v =
Runtime.lookup_signature >>= fun sgn ->
let j = Runtime.as_is_term ~at v in
match Nucleus.invert_is_term sgn j with
| Nucleus.Stump_TermAtom x -> return x
| Nucleus.(Stump_TermConstructor _ | Stump_TermMeta _ | Stump_TermConvert _... |
d8766189bf29010e6f3de865f66acfcb099d6f06ce6a2e3e8151c35bfbaab866 | anoma/juvix | cps.hs | compute the Nth Fibonacci number modulo 2 ^ 28 with CPS
go :: Int -> Int -> Int -> Int
go k n m = step k n m go
step :: Int -> Int -> Int -> (Int -> Int -> Int -> Int) -> Int
step 0 n m cont = n
step k n m cont = cont (k - 1) m ((n + m) `mod` (2 ^ 28))
fib :: Int -> Int
fib n = go n 0 1
main :: IO ()
main = putSt... | null | https://raw.githubusercontent.com/anoma/juvix/74bfe592f56064fd260e7a00417e495aa68bc1d0/tests/benchmark/cps/haskell/cps.hs | haskell | compute the Nth Fibonacci number modulo 2 ^ 28 with CPS
go :: Int -> Int -> Int -> Int
go k n m = step k n m go
step :: Int -> Int -> Int -> (Int -> Int -> Int -> Int) -> Int
step 0 n m cont = n
step k n m cont = cont (k - 1) m ((n + m) `mod` (2 ^ 28))
fib :: Int -> Int
fib n = go n 0 1
main :: IO ()
main = putSt... | |
6825b59943491e2f7b003cc70d73cc67d786338436576d41afbc3b479a2b46d7 | stardust66/openapi-type-provider | schema-type-provider.rkt | #lang typed/racket/base
(provide schema-type-provider
(for-syntax schema->typedef
property->field-definition
schema->writer
schema->read
schema->jsexpr
schema->typename)
JSExpr
string->js... | null | https://raw.githubusercontent.com/stardust66/openapi-type-provider/58981663b324707eb77b792bd7ccb7556c3d0992/schema-type-provider.rkt | racket | the appropriate functions for all of its properties. Given a Schema-Array,
define the same function for its item type.
Given a Schema, return the function (as a Symbol) that turns an instance
Also generate all type definitions that the current definition
refers to | #lang typed/racket/base
(provide schema-type-provider
(for-syntax schema->typedef
property->field-definition
schema->writer
schema->read
schema->jsexpr
schema->typename)
JSExpr
string->js... |
fefd35bfe0df6a2a72500a7ce73a17d1cc9d74e6a49d26fcf32387da41340b1c | uwplse/synapse | qm.rkt | #lang s-exp rosette
(require racket/generator racket/serialize rosette/lib/tools/angelic rosette/base/generic
"../../../opsyn/engine/eval.rkt"
"../../../opsyn/engine/metasketch.rkt"
"../../../opsyn/metasketches/imetasketch.rkt"
"../../../opsyn/metasketches/order.rkt")
(provide qm-m... | null | https://raw.githubusercontent.com/uwplse/synapse/10f605f8f1fff6dade90607f516550b961a10169/benchmarks/sygus/qm/qm.rkt | racket | Returns a metasketch for a given SyGuS QM problem.
The cost model for this metasketch is simply the
maximum depth of the expression tree.
0: a list of the same length as qm-program-inputs, where
each element is a symbol corresponding to an input variable name
Grammar with unwinding control. | #lang s-exp rosette
(require racket/generator racket/serialize rosette/lib/tools/angelic rosette/base/generic
"../../../opsyn/engine/eval.rkt"
"../../../opsyn/engine/metasketch.rkt"
"../../../opsyn/metasketches/imetasketch.rkt"
"../../../opsyn/metasketches/order.rkt")
(provide qm-m... |
169e9d4d237850001db18fc423776e213888be8627715a5fd4776c340d48a72e | ANSSI-FR/xsvgen | error.ml | (***********************************************************************)
(* *)
(* XML Schema Validator Generator *)
(* *)
( SafeRive... | null | https://raw.githubusercontent.com/ANSSI-FR/xsvgen/3c2b5e43e7adcb856a3a2aa01bfc039bf3c6459b/lib/error.ml | ocaml | *********************************************************************
XML Schema Validator Generator
... | ( SafeRiver )
Copyright 2012 , ANSSI and SafeRiver .
$ I d : error.ml 1704 2012 - 06 - 04 16:49:33Z maarek $
* { 1 Error types }
* Error
Error prefixes and conventions :
- [ * SEC _ * ] : Security constraints
- [ * ... |
43495283f974bd13304aeee03d2eea6ef49bd0c102bb78a381ab0c3b099d0b37 | essiene/erlami | amilist.erl | -module(amilist).
-export([
new/0,
set_value/3,
get_value/2,
del_value/2,
has_value/2,
has_key/2,
set_payload/2,
get_payload/1,
has_payload/1
]).
%% ==========================================================================
%%
Amilists are ... | null | https://raw.githubusercontent.com/essiene/erlami/c566f229c8bb1debe3c468c7124551b912bd6b1f/src/lib/amilist.erl | erlang | ==========================================================================
They are protocol aware.
like:
Key1: Value1\r\n
...
Optional payload without Key-Value mapping \r\n
that can spawn multiple lines and ends with
\r\n
Because they are protocol aware, each time we meet an optional
... | -module(amilist).
-export([
new/0,
set_value/3,
get_value/2,
del_value/2,
has_value/2,
has_key/2,
set_payload/2,
get_payload/1,
has_payload/1
]).
Amilists are Key Value lists with one optional keyless value called the
' payload ' . Amil... |
5e307a31245f0d396fb0264dbd93cf701e666208b75f5e61b1cc16a2bc986ea0 | mbouaziz/jsx | featuresList.ml |
open MyPervasives
module Feature =
struct
(* JS.Syntax.const *)
type js_const =
| FCString
| FCRegexp
| FCNum
| FCInt
| FCBool
| FCNull
| FCUndefined
type attr = LambdaJS.Syntax.attr
(* LambdaJS.Syntax.exp *)
type exp =
| FEConst of js_const
| FEId
| FEObject
|... | null | https://raw.githubusercontent.com/mbouaziz/jsx/b70768890e9e2d52e189d1a96f1a73c59a572a0f/featuresList.ml | ocaml | JS.Syntax.const
LambdaJS.Syntax.exp
`Op1Prefix "";
`Op2Infix "";
`Op3Prefix "";
true: add father length |
open MyPervasives
module Feature =
struct
type js_const =
| FCString
| FCRegexp
| FCNum
| FCInt
| FCBool
| FCNull
| FCUndefined
type attr = LambdaJS.Syntax.attr
type exp =
| FEConst of js_const
| FEId
| FEObject
| FEUpdateFieldSurface
| FEGetFieldSurface
| ... |
07bf29647bddcea50fc3e0a428858e86c0a9f6b61b5274f9d20b45243811e252 | conjure-cp/conjure | ExplicitBounded.hs | # LANGUAGE QuasiQuotes #
module Conjure.Representations.Sequence.ExplicitBounded ( sequenceExplicitBounded ) where
-- conjure
import Conjure.Prelude
import Conjure.Language
import Conjure.Language.ZeroVal ( zeroVal, EnumerateDomain )
import Conjure.Representations.Internal
import Conjure.Representations.Common
sequ... | null | https://raw.githubusercontent.com/conjure-cp/conjure/dd5a27df138af2ccbbb970274c2b8f22ac6b26a0/src/Conjure/Representations/Sequence/ExplicitBounded.hs | haskell | conjure
list
list
list
preparing structural constraints for the inner guys
list
list
list
list
preparing structural constraints for the inner guys | # LANGUAGE QuasiQuotes #
module Conjure.Representations.Sequence.ExplicitBounded ( sequenceExplicitBounded ) where
import Conjure.Prelude
import Conjure.Language
import Conjure.Language.ZeroVal ( zeroVal, EnumerateDomain )
import Conjure.Representations.Internal
import Conjure.Representations.Common
sequenceExplici... |
3642b6588bf456fbe6b2817092a3e2fb457a3c48cf710dba30e266f2c9361a54 | objectionary/try-phi | EOtoPhi.hs | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE TupleSections #
# LANGUAGE NamedFieldPuns #
module EOtoPhi(toMinimalTerm) where
import Data.Bifunctor (Bifunctor (second))
import Data.Function ((&))
import Data.Functor ((<&>))
import qualified Data.HashMap.Strict.InsO... | null | https://raw.githubusercontent.com/objectionary/try-phi/4adae4bf7b9c9604d61a00cd9e5ef228a9b188db/back/language-utils/src/EOtoPhi.hs | haskell | |
For now, will support simple expressions like
> eo { p a:b c } -> phi { p(b -> a)(_ -> c) }
>
> eo {
> [b] > a
> } ->
> phi { a -> [t -> 4, b -> ?] }
>
FIXME somehow use the names
TO-DO report errors
TO-DO use special names for attributes
not just @ and all others
get application arguments having a nam... | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE TupleSections #
# LANGUAGE NamedFieldPuns #
module EOtoPhi(toMinimalTerm) where
import Data.Bifunctor (Bifunctor (second))
import Data.Function ((&))
import Data.Functor ((<&>))
import qualified Data.HashMap.Strict.InsO... |
81386993ecbafc25148d13d21fc37dfd6f534b7abb1bc3ecd6291f32380ab353 | bos/rwh | DataEither.hs | import Prelude hiding (Maybe(..), Either(..))
{-- snippet Either --}
data Maybe a = Nothing
| Just a
deriving (Eq, Ord, Read, Show)
data Either a b = Left a
| Right b
deriving (Eq, Ord, Read, Show)
{-- /snippet Either --}
| null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch06/DataEither.hs | haskell | - snippet Either -
- /snippet Either - | import Prelude hiding (Maybe(..), Either(..))
data Maybe a = Nothing
| Just a
deriving (Eq, Ord, Read, Show)
data Either a b = Left a
| Right b
deriving (Eq, Ord, Read, Show)
|
3fb907693a544c53dc8de9936258c85d29edb546d4b8c8ff852e43710f339130 | Frama-C/Frama-C-snapshot | slicingMarks.mli | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/slicing/slicingMarks.mli | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.