_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 |
|---|---|---|---|---|---|---|---|---|
5cc792b3ebcd59a5809b04451c77551863faec13c588d9150c29f1f1a57332c3 | grasswire/chat-app | CommonSpec.hs | module Handler.CommonSpec (spec) where
import TestImport
spec :: Spec
spec = withApp $ do
describe "health check" $ do
it "gives a 200" $ do
get HealthCheckR
statusIs 200 | null | https://raw.githubusercontent.com/grasswire/chat-app/a8ae4e782cacd902d7ec9c68c40a939cc5cabb0a/backend/test/Handler/CommonSpec.hs | haskell | module Handler.CommonSpec (spec) where
import TestImport
spec :: Spec
spec = withApp $ do
describe "health check" $ do
it "gives a 200" $ do
get HealthCheckR
statusIs 200 | |
ff2973253934da4844c67633c9eefb12be5c5220eb38ac153c22f88ee20cf2a8 | clojure-interop/google-cloud-clients | SecurityCenterClient$ListFindingsPage.clj | (ns com.google.cloud.securitycenter.v1.SecurityCenterClient$ListFindingsPage
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.securitycenter.v1 SecurityCenterClient$ListFindingsPage]))
(defn create-page-async
"context - `com.google.api.gax.rpc.PageContext`
future-response - `com.goog... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.securitycenter/src/com/google/cloud/securitycenter/v1/SecurityCenterClient%24ListFindingsPage.clj | clojure | (ns com.google.cloud.securitycenter.v1.SecurityCenterClient$ListFindingsPage
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.securitycenter.v1 SecurityCenterClient$ListFindingsPage]))
(defn create-page-async
"context - `com.google.api.gax.rpc.PageContext`
future-response - `com.goog... | |
17971e221e3ab873d85d029c8e4336a42a67610ef46e4c265deba2cabbec89bc | ucsd-progsys/liquidhaskell | CyclicTypeAlias0.hs | @ LIQUID " --expect - error - containing = Cyclic type alias definition for ` CyclicA1 ` " @
module CyclicTypeAlias0 () where
@ type CyclicA1 = CyclicA2 @
@ type CyclicA2 = CyclicA1 @
| null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/errors/CyclicTypeAlias0.hs | haskell | @ LIQUID " --expect - error - containing = Cyclic type alias definition for ` CyclicA1 ` " @
module CyclicTypeAlias0 () where
@ type CyclicA1 = CyclicA2 @
@ type CyclicA2 = CyclicA1 @
| |
c8853bb5b653bc220b803e44b6fd850780597b923b03165f2280d8297f6240c8 | compiling-to-categories/concat | FFT.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE GADTs #-}
# LANGU... | null | https://raw.githubusercontent.com/compiling-to-categories/concat/49e554856576245f583dfd2484e5f7c19f688028/examples/src/ConCat/FFT.hs | haskell | # LANGUAGE CPP #
# LANGUAGE ConstraintKinds #
# LANGUAGE DataKinds #
# LANGUAGE DefaultSignatures #
# LANGUAGE FlexibleContexts #
# LANGUAGE GADTs #
# LANGUAGE ParallelListComp #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE PatternGuards ... | # LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wall #
#ifdef TESTING
# OPTIONS_GHC -fno - warn - unused - binds #
#endif
# define
module ConCat.FFT
( dft... |
b025a0c73778d52c7284de7e3fa2bbce688124fc7667809a92586d3329696d42 | haskell/fgl | GVD.hs | ( c ) 2000 - 2005 by [ see file COPYRIGHT ]
-- | Graph Voronoi Diagram
--
-- These functions can be used to create a /shortest path forest/
-- where the roots are specified.
module Data.Graph.Inductive.Query.GVD (
Voronoi,LRTree,
gvdIn,gvdOut,
voronoiSet,nearestNode,nearestDist,nearestPath,
-- vd... | null | https://raw.githubusercontent.com/haskell/fgl/86dc04d2ae9ca73a0923bdc8d78b53bf2f2876c8/Data/Graph/Inductive/Query/GVD.hs | haskell | | Graph Voronoi Diagram
These functions can be used to create a /shortest path forest/
where the roots are specified.
vd,nn,ns,
| Representation of a shortest path forest.
| Produce a shortest path forest (the roots of which are those
nodes (if possible).
| Produce a shortest path forest (the roots of... | ( c ) 2000 - 2005 by [ see file COPYRIGHT ]
module Data.Graph.Inductive.Query.GVD (
Voronoi,LRTree,
gvdIn,gvdOut,
voronoiSet,nearestNode,nearestDist,nearestPath,
vdO , nnO , nsO
) where
import Data.List (nub)
import Data.Maybe (listToMaybe)
import qualified Data.Graph.Inductive.Internal.Heap as ... |
f9402fcebc09d4f1a83802dbb7c0f8d133495743b61c70c7258cb5e72adf768a | anik545/OwlPPL | test_evaluation.ml | (* Module to test the evaluation module - hypothesis tests and kl divergence *)
open Ppl
open Core
open Core *)
let test_kl_discrete () = ()
let test_kl_continuous () = ()
let test_ks () = ()
let test_chisq () = ()
let tests : unit Alcotest.test list =
[
("discrete kl-div", [ ("", `Quick, test_kl_... | null | https://raw.githubusercontent.com/anik545/OwlPPL/ad650219769d5f32564cc771d63c9a52289043a5/ppl/test/unit_tests/test_evaluation.ml | ocaml | Module to test the evaluation module - hypothesis tests and kl divergence |
open Ppl
open Core
open Core *)
let test_kl_discrete () = ()
let test_kl_continuous () = ()
let test_ks () = ()
let test_chisq () = ()
let tests : unit Alcotest.test list =
[
("discrete kl-div", [ ("", `Quick, test_kl_continuous) ]);
("continuous kl-div", [ ("", `Quick, test_kl_discrete) ]);
... |
56959f89bf5a8ea81b1b67c8a338c093989cd881a7a614475fe09daf69120ac4 | synduce/Synduce | exists_equal_elems.ml | * @synduce -s 2 -NB --no - lifting --se2gis
type two_list = TwoLists of list * list
and list =
| Elt of int
| Cons of int * list
(* Invariant: sorted in decreasing order. *)
let rec is_sorted = function
| TwoLists (x, y) -> is_sorted_l x && is_sorted_l y
and is_sorted_l = function
| Elt x -> true
| Cons... | null | https://raw.githubusercontent.com/synduce/Synduce/42d970faa863365f10531b19945cbb5cfb70f134/benchmarks/incomplete/sortedlist/exists_equal_elems.ml | ocaml | Invariant: sorted in decreasing order.
Reference function in quadratic time. | * @synduce -s 2 -NB --no - lifting --se2gis
type two_list = TwoLists of list * list
and list =
| Elt of int
| Cons of int * list
let rec is_sorted = function
| TwoLists (x, y) -> is_sorted_l x && is_sorted_l y
and is_sorted_l = function
| Elt x -> true
| Cons (hd, tl) -> aux hd tl
and aux prev = functi... |
ed3e4aaedeb53db8e61427397f143b839e3cb3b28aff9b28ec63fa91d96899fc | ashleylwatson/HaskellsCastle | Player.hs | # LANGUAGE TemplateHaskell #
module Player (
Player(..), -- Character Storage [Room]
plch,rooms,
remOptOnRoom, -- Location -> Room -> Room
RoomOption - > Room - > Room
RoomOption - > Room - > Room
remOpt, -- Location -> Player -> Player
RoomOption - > Player - > Player
RoomOption - > Player - > Player... | null | https://raw.githubusercontent.com/ashleylwatson/HaskellsCastle/26e35a2beacfb317733900946572111d6feac0a7/src/Player.hs | haskell | Character Storage [Room]
Location -> Room -> Room
Location -> Player -> Player | # LANGUAGE TemplateHaskell #
module Player (
plch,rooms,
RoomOption - > Room - > Room
RoomOption - > Room - > Room
RoomOption - > Player - > Player
RoomOption - > Player - > Player
) where
import CharacUtil
import SelectSystem
import Battle
import Rooms
import Control.Lens
import Control.Monad
import Da... |
ec8358586ab66aa5fcdb6a3f1eeca4ac4666f09b434434d5b2975788d5d2d33d | incoherentsoftware/defect-process | Data.hs | module Enemy.All.Bomb.Data
( BombEnemyData(..)
, mkBombEnemyData
, isExplodeTimerActive
) where
import Control.Monad.IO.Class (MonadIO)
import Data.Maybe (isJust)
import Configs
import Configs.All.Enemy
import Enemy.All.Bomb.AttackDescriptions
import Enemy.All.Bomb.Behavior
import Enemy.Al... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/8797aad1d93bff5aadd7226c39a48f45cf76746e/src/Enemy/All/Bomb/Data.hs | haskell | module Enemy.All.Bomb.Data
( BombEnemyData(..)
, mkBombEnemyData
, isExplodeTimerActive
) where
import Control.Monad.IO.Class (MonadIO)
import Data.Maybe (isJust)
import Configs
import Configs.All.Enemy
import Enemy.All.Bomb.AttackDescriptions
import Enemy.All.Bomb.Behavior
import Enemy.Al... | |
aefd79e6da4ce962a3dc051bb5afd425e5b636485560454cae13212884ee9650 | cedlemo/OCaml-Notty-introduction | common_lwt.ml | open Notty
open Lwt.Infix
include Common
module T = Notty_lwt.Term
let simpleterm_lwt ~imgf ~f ~s =
let term = T.create () in
let imgf (w, h) s =
I.(string A.(fg lightblack) "[ESC quits.]" <-> imgf (w, h - 1) s) in
let step e s = match e with
| `Key (`Escape, []) | `Key (`Uchar 67, [`Ctrl]) ->
... | null | https://raw.githubusercontent.com/cedlemo/OCaml-Notty-introduction/9295b43382354c504d5efcad3ba56cff6f34d2eb/common_lwt.ml | ocaml | open Notty
open Lwt.Infix
include Common
module T = Notty_lwt.Term
let simpleterm_lwt ~imgf ~f ~s =
let term = T.create () in
let imgf (w, h) s =
I.(string A.(fg lightblack) "[ESC quits.]" <-> imgf (w, h - 1) s) in
let step e s = match e with
| `Key (`Escape, []) | `Key (`Uchar 67, [`Ctrl]) ->
... | |
17b6dffc50fc9b39fbaa375687a0084998d56654cc085f320b39815976fbb66f | HealthSamurai/re-form | dev.cljs | (ns ^:figwheel-no-load ui.dev
(:require [ui.core :as core]
[figwheel.client :as figwheel :include-macros true]
[re-frisk.core :refer [enable-re-frisk!]]
[devtools.core :as devtools]))
(devtools/install!)
(enable-console-print!)
(figwheel/watch-and-reload
:websocket-url "ws:300... | null | https://raw.githubusercontent.com/HealthSamurai/re-form/810321d67e3946876c834998e3472d0693846953/example/env/dev/cljs/ui/dev.cljs | clojure | (ns ^:figwheel-no-load ui.dev
(:require [ui.core :as core]
[figwheel.client :as figwheel :include-macros true]
[re-frisk.core :refer [enable-re-frisk!]]
[devtools.core :as devtools]))
(devtools/install!)
(enable-console-print!)
(figwheel/watch-and-reload
:websocket-url "ws:300... | |
34309599320666141b91336a49ce80cc3c34f4e9a17bac106f9a913f899f3210 | heraldry/heraldicon | rustre.cljs | (ns heraldicon.heraldry.charge.type.rustre
(:require
[heraldicon.heraldry.charge.interface :as charge.interface]
[heraldicon.heraldry.charge.shared :as charge.shared]
[heraldicon.interface :as interface]))
(def charge-type :heraldry.charge.type/rustre)
(defmethod charge.interface/display-name charge-type [... | null | https://raw.githubusercontent.com/heraldry/heraldicon/3b52869f611023b496a29473a98c35ca89262aab/src/heraldicon/heraldry/charge/type/rustre.cljs | clojure | (ns heraldicon.heraldry.charge.type.rustre
(:require
[heraldicon.heraldry.charge.interface :as charge.interface]
[heraldicon.heraldry.charge.shared :as charge.shared]
[heraldicon.interface :as interface]))
(def charge-type :heraldry.charge.type/rustre)
(defmethod charge.interface/display-name charge-type [... | |
b4c0b7536b6d455b1a2e7a079461a85d174537fa263810aeee42977f2c06b34b | SamB/coq | vernac.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/SamB/coq/8f84aba9ae83a4dc43ea6e804227ae8cae8086b1/toplevel/vernac.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i $Id$ i
Parsing of vernacular.
S... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Read a vernac command o... |
379851012482adeb22400ec35edcde569c3cc019a511a39f38a4c78b854bc927 | ocaml/ocamlbuild | hygiene.ml | (***********************************************************************)
(* *)
(* ocamlbuild *)
(* *)
, , projet Galliu... | null | https://raw.githubusercontent.com/ocaml/ocamlbuild/792b7c8abdbc712c98ed7e69469ed354b87e125b/src/hygiene.ml | ocaml | *********************************************************************
ocamlbuild
... | , , projet Gallium , INRIA Rocquencourt
Copyright 2007 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
Original author :
open My_std
open Slurp
excepti... |
076abef98dc8f8e7cbf2b56035417fd15a1e56bc49f582477193d1a6c8b08ad4 | facebook/pyre-check | dependencyTrackedMemoryTest.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/7f6b6970681966bda8066b6450043b349ab65749/source/service/test/dependencyTrackedMemoryTest.ml | ocaml | Ensure that different tables' same keys are encoded differently
Ensure that `reset_shared_memory` correctly resets all dependency-related info
Ensure that the `get` interface also adds the corresponding dependencies
Final cleanup |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
49a6601fa5b622977be6d744da6b334c858569371f4e062f8e8a7a27a1b05837 | graninas/Pragmatic-Type-Level-Design | Conv.hs | module HCell.Gloss.Conv where
import CPrelude
import HCell.Types
import HCell.Gloss.Types
coordsToGlossCell :: GlossBaseShift -> GridCellSize -> Coords -> GlossCoords
coordsToGlossCell
(GlossBaseShift (shiftX, shiftY))
(GridCellSize cellSize)
(x, y)
= GlossCoords (x', y')
where
x' = shiftX + fromInteg... | null | https://raw.githubusercontent.com/graninas/Pragmatic-Type-Level-Design/a95f9a5d7ae5b443b9d8ef77b27f1aecf02f461a/demo-apps/hcell/src/HCell/Gloss/Conv.hs | haskell | module HCell.Gloss.Conv where
import CPrelude
import HCell.Types
import HCell.Gloss.Types
coordsToGlossCell :: GlossBaseShift -> GridCellSize -> Coords -> GlossCoords
coordsToGlossCell
(GlossBaseShift (shiftX, shiftY))
(GridCellSize cellSize)
(x, y)
= GlossCoords (x', y')
where
x' = shiftX + fromInteg... | |
5f5c864fa0d326005d9d11d346978e8868cc095a36e56385bbbed7349bb65af1 | synduce/Synduce | Skeleton.ml | open Base
open EProps
open Term
open Option.Let_syntax
open Utils
(** A type to represent a grammar guess. *)
type t =
| SChoice of t list (** A choice of possible guesses. *)
| SBin of Binop.t * t * t (** A binary expression. *)
| SUn of Unop.t * t (** A unary expression. *)
| SIte of t * t * t (** An if-t... | null | https://raw.githubusercontent.com/synduce/Synduce/48a258db3fc677d97587d0fb34eaa11f9d239ed5/src/lang/Skeleton.ml | ocaml | * A type to represent a grammar guess.
* A choice of possible guesses.
* A binary expression.
* A unary expression.
* An if-then-else.
* A guess of some type (to be filled with the appropriate non-terminal).
* A direct reference to a function argument. | open Base
open EProps
open Term
open Option.Let_syntax
open Utils
type t =
| SType of RType.t
| STypedWith of RType.t * t list
| STuple of t list
| SNonGuessable
let rec pp (frmt : Formatter.t) (sk : t) : unit =
match sk with
| SChoice l -> Fmt.(pf frmt "(%a)" (list ~sep:vbar pp) l)
| SBin (op, a, b) ->... |
0c492125c5fac3cb8f0a918a32b7d22736fcd20787dfb35815a162ee6590dd7a | lukstafi/invargent | Terms.ml | * Data structures and printing for InvarGenT.
Released under the GNU General Public Licence ( version 2 or
higher ) , NO WARRANTY of correctness etc . ( C ) 2013
@author ( AT ) gmail.com
@since Mar 2013
Released under the GNU General Public Licence (version 2 or
higher), NO WARR... | null | https://raw.githubusercontent.com/lukstafi/invargent/e25d8b12d9f9a8e2d5269001dd14cf93abcb7549/src/Terms.ml | ocaml | when same_level
when same_level
* {3 Formulas}
TODO: optimize
Using "X" because "script chi" is not available on all systems.
* {2 Unification}
FIXME: fail on out-of-scope parameters.
* Separate type sort and number sort constraints,
assert false
TODO: could use [unify] by treating [vs] as [Downstream]... | * Data structures and printing for InvarGenT.
Released under the GNU General Public Licence ( version 2 or
higher ) , NO WARRANTY of correctness etc . ( C ) 2013
@author ( AT ) gmail.com
@since Mar 2013
Released under the GNU General Public Licence (version 2 or
higher), NO WARR... |
178b619e82fb8bf6a876cdf8e4d4094e37be9512b12235cd913a74d30baa5193 | monadbobo/ocaml-core | pipe.ml | open Core.Std
open Import
open Deferred_std
module Stream = Async_stream
module Q = Queue
let show_debug_messages = ref false
let check_invariant = ref false
module Blocked_read = struct
A [ Blocked_read.t ] represents a blocked read attempt . If someone reads from an empty
pipe , they enqueue a [ Blocked_... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/async/core/lib/pipe.ml | ocaml | A [Blocked_flush.t] represents a blocked flush operation, which can be enabled by a
future read. If someone does [flushed p] on a pipe, that blocks until everything
that's currently in the pipe at that point has drained out of the pipe. When we call
[flushed], it records the total amount of data that ... | open Core.Std
open Import
open Deferred_std
module Stream = Async_stream
module Q = Queue
let show_debug_messages = ref false
let check_invariant = ref false
module Blocked_read = struct
A [ Blocked_read.t ] represents a blocked read attempt . If someone reads from an empty
pipe , they enqueue a [ Blocked_... |
4376c08101094ccc5e42ba63806e2ebf6ceb026312b9fc6b444e3f9334d1dc79 | chefy-io/clojure-katas | reverse_binary.clj | (ns clojure-katas.reverse-binary
(:require [clojure-katas.core :as core]))
(core/defproblem compute
"Credit: Spotify Puzzle: /
Your task will be to write a program for reversing numbers in binary.
For instance, the binary representation of 13 is 1101,
and reversing it gives 1011, which corresponds to nu... | null | https://raw.githubusercontent.com/chefy-io/clojure-katas/81efe02dfe5add9e10146e10dd2b34f072f7686e/src/clojure_katas/reverse_binary.clj | clojure | (ns clojure-katas.reverse-binary
(:require [clojure-katas.core :as core]))
(core/defproblem compute
"Credit: Spotify Puzzle: /
Your task will be to write a program for reversing numbers in binary.
For instance, the binary representation of 13 is 1101,
and reversing it gives 1011, which corresponds to nu... | |
34caf8fd87cdba4e8a6b1eeead09dc18cf6bcf72efb35145b1bb80ec70ed4336 | AndrewRademacher/aeson-casing | Main.hs | module Main where
import Test.Tasty
import qualified Data.Aeson.Casing.Test as Casing
main :: IO ()
main = defaultMain $ testGroup "Tests"
[ Casing.tests
]
| null | https://raw.githubusercontent.com/AndrewRademacher/aeson-casing/a6acbc40f6cffce7692cab5022d98732dc7a68b3/test/Main.hs | haskell | module Main where
import Test.Tasty
import qualified Data.Aeson.Casing.Test as Casing
main :: IO ()
main = defaultMain $ testGroup "Tests"
[ Casing.tests
]
| |
0495bf870b7091f7f8e760878697a749c52b7e23ac46e3e2be245cfb9af17c7a | ahrefs/devkit | stage_merge.ml | open Enum
type ('a,'b) value = Left of 'a | Right of 'b | Both of ('a * 'b)
let stage_merge compare ~left ~right ~multi return key1 key2 v1 v2 =
let multi_ret next found ret =
match left, multi with
| true, true -> .< if not .~found then .~ret else .~next () >.
| true, false -> ret
| false, _ -> .< ... | null | https://raw.githubusercontent.com/ahrefs/devkit/559c2df8f6eacb091e0eac38f508c45b6567bdd8/stage_merge.ml | ocaml | helpers
csp
generate
assoc doesn't need `by`, has explicit key already
we don't want non-`by` variants, except for assoc which has explicit key | open Enum
type ('a,'b) value = Left of 'a | Right of 'b | Both of ('a * 'b)
let stage_merge compare ~left ~right ~multi return key1 key2 v1 v2 =
let multi_ret next found ret =
match left, multi with
| true, true -> .< if not .~found then .~ret else .~next () >.
| true, false -> ret
| false, _ -> .< ... |
4f7f065d4cd36b388f8f176045c0cd45dc9f11e1767c0b1cc9ff50700a0ff4cd | huiyaozheng/Mirage-zmq | config.ml | open Mirage
let main = foreign ~packages:[package "mirage-zmq"] "Unikernel.Main" (stackv4 @-> job)
let stack = generic_stackv4 default_network
let () =
register "push_unikernel" [
main $ stack
]
| null | https://raw.githubusercontent.com/huiyaozheng/Mirage-zmq/af288a3378a7c357bd5646a3abf4fd5ae777369b/test/Queue_size/PUSH_send_limited/config.ml | ocaml | open Mirage
let main = foreign ~packages:[package "mirage-zmq"] "Unikernel.Main" (stackv4 @-> job)
let stack = generic_stackv4 default_network
let () =
register "push_unikernel" [
main $ stack
]
| |
099ce67802219c218f8a1d8b7496f32466fbaa72cdf4d96a8e93699b7a898034 | nvim-treesitter/nvim-treesitter | injections.scm | [
(line_comment)
(block_comment)
(nesting_block_comment)
] @comment
(token_string_tokens) @d
| null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/c2c454c29a92e2d0db955fc1d6841566c28e3ecd/queries/d/injections.scm | scheme | [
(line_comment)
(block_comment)
(nesting_block_comment)
] @comment
(token_string_tokens) @d
| |
e50f630ac7eb2a3f005afa19eb5301c60b55c1f907e21ddb42f860dfe2a1bab7 | Cahu/krpc-hs | KerbalAlarmClock.hs | module KRPCHS.KerbalAlarmClock
( AlarmAction(..)
, AlarmType(..)
, Alarm
, alarmWithName
, alarmWithNameStream
, alarmWithNameStreamReq
, alarmRemove
, getAlarmAction
, getAlarmActionStream
, getAlarmActionStreamReq
, getAlarmID
, getAlarmIDStream
, getAlarmIDStreamReq
, getAlarmMargin
, getAlarmMarginStream
, getAlarm... | null | https://raw.githubusercontent.com/Cahu/krpc-hs/418f88f2acad8d50dd716d9a3477178332f00806/src/KRPCHS/KerbalAlarmClock.hs | haskell |
- The action performed by an alarm when it fires.
- The type of an alarm.
- Removes the alarm.
- The action that the alarm triggers.
- The unique identifier for the alarm.
- The short name of the alarm.
- The long description of the alarm.
- Whether the alarm will be repeated after it has ... | module KRPCHS.KerbalAlarmClock
( AlarmAction(..)
, AlarmType(..)
, Alarm
, alarmWithName
, alarmWithNameStream
, alarmWithNameStreamReq
, alarmRemove
, getAlarmAction
, getAlarmActionStream
, getAlarmActionStreamReq
, getAlarmID
, getAlarmIDStream
, getAlarmIDStreamReq
, getAlarmMargin
, getAlarmMarginStream
, getAlarm... |
ce238055a77324f6d2b209d49463264b79d0c2be3ccbde591fa43f67765de28e | LaurentMazare/ocaml-torch | predict.ml | Evaluation using a pre - trained ResNet model .
The pre - trained weight file can be found at :
-torch/releases/download/v0.1-unstable/resnet18.ot
-torch/releases/download/v0.1-unstable/resnet34.ot
-torch/releases/download/v0.1-unstable/densenet121.ot
-torch/releases/download/v0.1-uns... | null | https://raw.githubusercontent.com/LaurentMazare/ocaml-torch/a82b906a22c7c23138af16fab497a08e5167d249/examples/pretrained/predict.ml | ocaml | Evaluation using a pre - trained ResNet model .
The pre - trained weight file can be found at :
-torch/releases/download/v0.1-unstable/resnet18.ot
-torch/releases/download/v0.1-unstable/resnet34.ot
-torch/releases/download/v0.1-unstable/densenet121.ot
-torch/releases/download/v0.1-uns... | |
faeafba2472ba87524b703da4fe7a9b86bd88da91766bd132e7369c76576c675 | shayne-fletcher/zen | test_dot.ml | module Dotfile = struct
let open_write (name : string) (buf : string) : unit=
let ch = open_out name in
output ch buf 0 (String.length buf) ; close_out ch
let image_of_dotfile (dotfile : string) =
let pid = Unix.create_process "dot.exe" [|"dot.exe"; "-Tpng"; "-O"; dotfile|] Unix.stdin Unix.stdout Unix.... | null | https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/gt/test_dot.ml | ocaml | module Dotfile = struct
let open_write (name : string) (buf : string) : unit=
let ch = open_out name in
output ch buf 0 (String.length buf) ; close_out ch
let image_of_dotfile (dotfile : string) =
let pid = Unix.create_process "dot.exe" [|"dot.exe"; "-Tpng"; "-O"; dotfile|] Unix.stdin Unix.stdout Unix.... | |
622e01fa37331b56a16744e60bfff022f735f941c043f4db081368d1dafa741c | ucsd-progsys/liquidhaskell | Ple1.hs | {-@ LIQUID "--expect-any-error" @-}
-- this tests reflection + PLE + holes
{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--ple" @-}
module Ple1 where
import Ple1Lib
@ check : : _ - > { adder 10 20 = = 300 } @
check () = ()
| null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/measure/neg/Ple1.hs | haskell | @ LIQUID "--expect-any-error" @
this tests reflection + PLE + holes
@ LIQUID "--reflection" @
@ LIQUID "--ple" @ |
module Ple1 where
import Ple1Lib
@ check : : _ - > { adder 10 20 = = 300 } @
check () = ()
|
8ffe4c6acd82432be5da0d29f8da6a447ebb8c31db7335bce88d1e84ded5e638 | greghendershott/frog | params.rkt | #lang racket/base
(require racket/match
"./util.rkt")
(provide (all-defined-out))
(module+ test
(require rackunit))
(define current-scheme/host (make-parameter ""))
(define current-uri-prefix
(make-parameter #f
(λ (v)
(and v
(match (regexp-... | null | https://raw.githubusercontent.com/greghendershott/frog/93d8b442c2e619334612b7e2d091e4eb33995021/frog/private/params.rkt | racket | index pages: full posts?
feeds: full posts?
beep (hopefully) | #lang racket/base
(require racket/match
"./util.rkt")
(provide (all-defined-out))
(module+ test
(require rackunit))
(define current-scheme/host (make-parameter ""))
(define current-uri-prefix
(make-parameter #f
(λ (v)
(and v
(match (regexp-... |
113cd76fd81233f9aecab2ca8871cd1c8b091990961fef8e178b4baf86c144d0 | facebookarchive/duckling_old | measure.clj | (
;; Distance
;; NEED TO PUSH THE NORMALIZATION IN THE HELPER + CREATE Function to combine distance
" two distance tokens in a row "
[ ( dim : distance # ( not (: latent % ) ) ) ( dim : distance # ( not (: latent % ) ) ) ] ; sequence of two tokens with a distance dimension
( combine - distance % 1 % 2 )
... | null | https://raw.githubusercontent.com/facebookarchive/duckling_old/bf5bb9758c36313b56e136a28ba401696eeff10b/resources/languages/ko/rules/measure.clj | clojure | Distance
NEED TO PUSH THE NORMALIZATION IN THE HELPER + CREATE Function to combine distance
sequence of two tokens with a distance dimension
same thing , with " and " in between like " 3 feets and 2 inches "
sequence of two tokens with a time fn
latent distance
temporary hack
volume
latent volume
Quantity
qua... | (
" two distance tokens in a row "
( combine - distance % 1 % 2 )
" two distance tokens separated by and "
( combine - distance % 1 % 3 )
"number as distance"
(dim :number)
{:dim :distance
:latent true
:value (:value %1)}
"half"
#"반"
{:dim :distance
:latent true
:value 0.5 }
"<latent dist... |
ed2b97da363598f339b1bc22c237b17ada2ef6a918262b05b6d5b5143388ba8a | mpenet/hayt | dsl.clj | (ns qbits.hayt.dsl
(:refer-clojure :exclude [update group-by])
(:require [qbits.hayt.ns :as uns]))
(doseq [module '(statement clause)]
(uns/alias-ns (symbol (str "qbits.hayt.dsl." module))))
| null | https://raw.githubusercontent.com/mpenet/hayt/7bbc06fae481bda89295dcc39d06382c4ba64568/src/clj/qbits/hayt/dsl.clj | clojure | (ns qbits.hayt.dsl
(:refer-clojure :exclude [update group-by])
(:require [qbits.hayt.ns :as uns]))
(doseq [module '(statement clause)]
(uns/alias-ns (symbol (str "qbits.hayt.dsl." module))))
| |
4550cc97e8d36c4bcd7faa791b0f2648bb098fd8682491884ec62aeeb22a9774 | herd/herdtools7 | op.mli | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/d0fa745ab09a1607b4a192f8fcb16548786f7a9e/lib/op.mli | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2010 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
7c5b00aafcdd2ee27d01109273a734a6c80b3d920f508694fd36e8b0fc66c9f3 | ocaml-multicore/tezos | test_activation.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
(* ... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_alpha/lib_protocol/test/integration/operations/test_activation.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETH... |
cc00e76cf3b1a21e8dbd44f77038ed0125a5bd3ba7ff7ca87c91d4114084d45a | andrewthad/chronos | Spec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE StandaloneDeriving #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE NumericUnderscores #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Main (main) where
import Chronos.Types
import qualified Data.Aeson as AE
import Data.ByteString (ByteString)
import ... | null | https://raw.githubusercontent.com/andrewthad/chronos/49a5605860746bbfc6e75dff3fbc69b69ea92338/test/Spec.hs | haskell | # LANGUAGE OverloadedStrings #
We increase the default number of property-based tests (provided
almost nothing.
Atto.parseOnly (p <* Atto.endOfInput) t
@?= Left expected
never use leap seconds for property-based tests
instance Arbitrary UtcTime where
arbitrary = UtcTime
<$> fmap Day (choose (-100000,100... | # LANGUAGE StandaloneDeriving #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE NumericUnderscores #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Main (main) where
import Chronos.Types
import qualified Data.Aeson as AE
import Data.ByteString (ByteString)
import Data.Int (Int64)
import Data.List (... |
8f1cc9af640f11b88245c617fd2151ca852e7bf37a5e430fe4862c683388d324 | thomanil/clojureTetris | model.clj | (ns clojureTetris.model)
FIXME Trim down shape matrices , and factor rotate funs to take any matrix dimensions ( not just 4x4 )
(def base-square-shape [[0 0 0 0]
[0 1 1 0]
[0 1 1 0]
[0 0 0 0]])
(def base-I-shape [[0 0 1 0]
[0 0 1 0]
[0 0 1 0]
[0 0 1 0]])
(def base-S-right-shape [[0 0 0 0... | null | https://raw.githubusercontent.com/thomanil/clojureTetris/6cd9ba6750261e4790cfd7af5c146ba028d370cd/src/clojureTetris/model.clj | clojure | (ns clojureTetris.model)
FIXME Trim down shape matrices , and factor rotate funs to take any matrix dimensions ( not just 4x4 )
(def base-square-shape [[0 0 0 0]
[0 1 1 0]
[0 1 1 0]
[0 0 0 0]])
(def base-I-shape [[0 0 1 0]
[0 0 1 0]
[0 0 1 0]
[0 0 1 0]])
(def base-S-right-shape [[0 0 0 0... | |
58888586f9449974baa36d07fdaa158eb836bc050949ed286fb68b60b31b6e37 | OCamlPro/ocp-build | buildOCamlMeta.mli | (**************************************************************************)
(* *)
(* Typerex Tools *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/tools/ocp-build/ocaml/buildOCamlMeta.mli | ocaml | ************************************************************************
Typerex Tools
... | Copyright 2011 - 2017 OCamlPro SAS
the GNU General Public License version 3 described in the file
val load_META_files : BuildOCP.state -> string -> string -> unit
|
95b501b5d4dd1dc0c2a8a3a4ee76619bc27bbe8dfeec18b739602c2b1ca4410c | plumatic/plumbing | positional.clj | (ns plumbing.graph.positional
"A compilation method for graphs that avoids maps for speed.
Prone to failure for graphs with more nodes than `max-graph-size`."
(:use plumbing.core)
(:require
[schema.core :as s]
[plumbing.fnk.schema :as schema]
[plumbing.fnk.pfnk :as pfnk]
[plumbing.fnk.impl :as fnk-i... | null | https://raw.githubusercontent.com/plumatic/plumbing/e0fbe3dbe47a7d52e7bfbf2e94edffbed5351308/src/plumbing/graph/positional.clj | clojure | NOTE: This eval is needed because we want to define a record based on
information (a graph) that's only available at runtime.
Name it just for kicks.
workaround evaluation quirks | (ns plumbing.graph.positional
"A compilation method for graphs that avoids maps for speed.
Prone to failure for graphs with more nodes than `max-graph-size`."
(:use plumbing.core)
(:require
[schema.core :as s]
[plumbing.fnk.schema :as schema]
[plumbing.fnk.pfnk :as pfnk]
[plumbing.fnk.impl :as fnk-i... |
c66a3c300edd5b38adc4fc5233da36200715cbe5280e520a9e14533fe57337a7 | rizo/snowflake-os | lexing.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/libraries/stdlib/lexing.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 GNU Library General Public License , with
$ I d : lexing.ml , v 1.24 2005 - 10 ... |
f15aa7801dfa96d2f3d442d3e40dd0bc9204e07671d0345404ed1cf45a2bccaa | inaka/elvis_core | fail_export_used_types.erl | -module fail_export_used_types.
-type my_type() :: my | type.
-export [my_fun/1].
-spec my_fun(my_type()) -> my_type().
my_fun(my) -> type;
my_fun(type) -> my.
| null | https://raw.githubusercontent.com/inaka/elvis_core/72df3ba9dae03cb070fa7af3b266c38bb3095778/test/examples/fail_export_used_types.erl | erlang | -module fail_export_used_types.
-type my_type() :: my | type.
-export [my_fun/1].
-spec my_fun(my_type()) -> my_type().
my_fun(my) -> type;
my_fun(type) -> my.
| |
ab49e924ecb11d0f8d9f0d02ceb7cac2d61183d2c6cd210e9125d0214ccffd9c | ocaml/dune | x.ml | let buy_it = "buy " ^ Lib.Y.it
let () = print_endline buy_it
| null | https://raw.githubusercontent.com/ocaml/dune/fc7b95148e1c71c4cb322dc852b6b6514044c611/test/blackbox-tests/test-cases/melange/mli.t/x.ml | ocaml | let buy_it = "buy " ^ Lib.Y.it
let () = print_endline buy_it
| |
5c2dc8801701a1bc5f544609493319c613a80b0ed488d2905fc793c04d84235e | ragkousism/Guix-on-Hurd | wordnet.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 , 2016 < >
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundati... | null | https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/packages/wordnet.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013 , 2016 < >
Copyright © 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages wordnet)
#:use-module (guix packages)
#:use-modu... |
8df5329bcccf00c1c828d863403def5c779c655cae29b3e44c76b2c9759a040f | fission-codes/fission | Types.hs | module Fission.Web.Server.PowerDNS.Types
( URL (..)
, ApiKey (..)
) where
import Fission.Prelude
newtype URL = URL { getUrl :: Text }
deriving newtype ( Eq
, Display
, Show
, FromJSON
, IsString
)
newtype... | null | https://raw.githubusercontent.com/fission-codes/fission/a0b46415e1e8b858aa6c6e503a7f2943a14e8218/fission-web-server/library/Fission/Web/Server/PowerDNS/Types.hs | haskell | module Fission.Web.Server.PowerDNS.Types
( URL (..)
, ApiKey (..)
) where
import Fission.Prelude
newtype URL = URL { getUrl :: Text }
deriving newtype ( Eq
, Display
, Show
, FromJSON
, IsString
)
newtype... | |
a945c82e5b2b92f0e9f0d2a0ba270180b9674e1caeb57e3bba25cb397c7d1933 | ranjitjhala/haddock-annot | Hidden.hs | -- #hide
module Hidden where
hidden :: Int -> Int
hidden a = a
| null | https://raw.githubusercontent.com/ranjitjhala/haddock-annot/ffaa182b17c3047887ff43dbe358c246011903f6/haddock-2.9.3/examples/Hidden.hs | haskell | #hide | module Hidden where
hidden :: Int -> Int
hidden a = a
|
c089b363b400ec38462f900079a9b5527009073935cea23505c7e520fe8dd0f2 | robert-strandh/SICL | cleavir-configuration.lisp | (cl:in-package #:sicl-boot)
(defmethod cleavir-literals:allocate-lexical-location
((client client) environment)
(cleavir-ast:make-ast 'cleavir-ast:lexical-ast :name (gensym)))
(defmethod cleavir-literals:convert-initialization-form
((client client) form environment)
(let ((cst (cst:cst-from-expression for... | null | https://raw.githubusercontent.com/robert-strandh/SICL/9b3d43fe05ee84beaca6da22e17e14dbc55d9375/Code/Boot/cleavir-configuration.lisp | lisp | (cl:in-package #:sicl-boot)
(defmethod cleavir-literals:allocate-lexical-location
((client client) environment)
(cleavir-ast:make-ast 'cleavir-ast:lexical-ast :name (gensym)))
(defmethod cleavir-literals:convert-initialization-form
((client client) form environment)
(let ((cst (cst:cst-from-expression for... | |
3e90bd8d52dbb87c15da4bdb5977725700c6c64e4ba30b99d3e040a0cc3d39ef | racket/typed-racket | opaque-object-contract.rkt | #;
(exn-pred #rx"uncontracted typed.*blaming: .*opaque-object-contract.rkt")
#lang racket/base
(module a typed/racket/optional
(provide c%)
(define c%
(class object%
(super-new)
(define/public (m) (void)))))
(module b typed/racket/deep
(require/typed (submod ".." a) [c% (Class [m (-> Void)])])
... | null | https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/fail/optional/opaque-object-contract.rkt | racket | (exn-pred #rx"uncontracted typed.*blaming: .*opaque-object-contract.rkt")
#lang racket/base
(module a typed/racket/optional
(provide c%)
(define c%
(class object%
(super-new)
(define/public (m) (void)))))
(module b typed/racket/deep
(require/typed (submod ".." a) [c% (Class [m (-> Void)])])
(p... | |
28b58bdd80150ba02bbd6b37a5588bbcba996b43d6f857c9b3f1510fe3e16ded | rescript-lang/rescript-compiler | TranslateStructure.ml | open GenTypeCommon
let rec addAnnotationsToTypes_ ~config ~(expr : Typedtree.expression)
(argTypes : argType list) =
match (expr.exp_desc, expr.exp_type.desc, argTypes) with
| _, _, {aName; aType = GroupOfLabeledArgs fields} :: nextTypes ->
let fields1, nextTypes1 =
addAnnotationsToFields ~config exp... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/6c4514c4c80f440a9f7f9cf4ae7721bdac315b57/jscomp/gentype/TranslateStructure.ml | ocaml | Underscore "_" appears as "param", can occur more than once
* Recover from expr the renaming annotations on named arguments.
Only look at the resulting type of the module
external declaration | open GenTypeCommon
let rec addAnnotationsToTypes_ ~config ~(expr : Typedtree.expression)
(argTypes : argType list) =
match (expr.exp_desc, expr.exp_type.desc, argTypes) with
| _, _, {aName; aType = GroupOfLabeledArgs fields} :: nextTypes ->
let fields1, nextTypes1 =
addAnnotationsToFields ~config exp... |
257a026dbfc8946da9d7913a8a13b194afecf0dce2365fd07c9524ba7586c87b | esl/MongooseIM | mongoose_graphql_vcard_admin_mutation.erl | -module(mongoose_graphql_vcard_admin_mutation).
-behaviour(mongoose_graphql).
-include("mod_vcard.hrl").
-export([execute/4]).
-import(mongoose_graphql_helper, [make_error/2]).
-ignore_xref([execute/4]).
-include("../mongoose_graphql_types.hrl").
-include("mongoose.hrl").
-include("jlib.hrl").
execute(_Ctx, vcard... | null | https://raw.githubusercontent.com/esl/MongooseIM/25671900c8593d37088cd069514d5eade9085f5b/src/graphql/admin/mongoose_graphql_vcard_admin_mutation.erl | erlang | -module(mongoose_graphql_vcard_admin_mutation).
-behaviour(mongoose_graphql).
-include("mod_vcard.hrl").
-export([execute/4]).
-import(mongoose_graphql_helper, [make_error/2]).
-ignore_xref([execute/4]).
-include("../mongoose_graphql_types.hrl").
-include("mongoose.hrl").
-include("jlib.hrl").
execute(_Ctx, vcard... | |
46bc62cc8b8231e6b74e63c6c3f9c3a291f67a38b2aa7a530bd09fa84b83fb7d | ruricolist/cloture | clojure-repl.lisp | (in-package #:cloture)
(in-readtable clojure-shortcut)
(defun compile-and-eval (form)
(funcall (compile nil (eval `(lambda () ,form)))))
(defun repl ()
(with-clojure-printer ()
(let ((*readtable* (find-readtable 'cloture))
(*package* (find-package "user")))
(catch 'quit
(loop (format t... | null | https://raw.githubusercontent.com/ruricolist/cloture/623c15c8d2e5e91eb87f46e3ecb3975880109948/clojure-repl.lisp | lisp | (in-package #:cloture)
(in-readtable clojure-shortcut)
(defun compile-and-eval (form)
(funcall (compile nil (eval `(lambda () ,form)))))
(defun repl ()
(with-clojure-printer ()
(let ((*readtable* (find-readtable 'cloture))
(*package* (find-package "user")))
(catch 'quit
(loop (format t... | |
177b634f60d96598740be4890cebfa30722350d0f78e45b84cb8d91ebd11755d | zadean/xqerl | xqldb_string_table2.erl | Copyright ( c ) 2018 - 2020 .
SPDX - FileCopyrightText : 2022
%
SPDX - License - Identifier : Apache-2.0
A string table is a lookup for each distinct string and a 32 bit integer .
%% The ID for the string is made up of a hash followed by a pigeonhole
%% offset value in case of collision.
%% When a co... | null | https://raw.githubusercontent.com/zadean/xqerl/06c651ec832d0ac2b77bef92c1b4ab14d8da8883/src/xqldb_string_table2.erl | erlang |
The ID for the string is made up of a hash followed by a pigeonhole
offset value in case of collision.
When a collision occurs, the offset is increased and appended to the hash.
When there is no collision, 0 is appended.
Looking up a value by string means getting its hash value, appending
is found. This means th... | Copyright ( c ) 2018 - 2020 .
SPDX - FileCopyrightText : 2022
SPDX - License - Identifier : Apache-2.0
A string table is a lookup for each distinct string and a 32 bit integer .
min and ( all 1 bits ) tails , and then selecting each possible ID until it
Linear Probing
-module(xqldb_string_tabl... |
71b7ac18f28d937cc0fcee0a291e71d0ab1740883e33099cba841db695a56517 | unnohideyuki/bunny | sample215.hs | take' :: Int -> [a] -> [a]
take' n xs | n <= 0 = []
take' n [] = []
take' n (x:xs) = x : take' (n-1) xs
main = print $ take' 5 [1, 2, 3, 4, 5, 6, 7]
| null | https://raw.githubusercontent.com/unnohideyuki/bunny/501856ff48f14b252b674585f25a2bf3801cb185/compiler/test/samples/sample215.hs | haskell | take' :: Int -> [a] -> [a]
take' n xs | n <= 0 = []
take' n [] = []
take' n (x:xs) = x : take' (n-1) xs
main = print $ take' 5 [1, 2, 3, 4, 5, 6, 7]
| |
5576972b7363e1c133a95a5637c02194ca290fa046833d99fdc6cde0cdec947e | m4b/rdr | MachImports.ml | open Binary
open MachBindOpcodes
open MachLoadCommand
(* table of tuples:
<seg-index, seg-offset, type, symbol-library-ordinal, symbol-name, addend>
symbol flags are undocumented
*)
(* TODO: move the special fields (if any) and match them with what's on disk/in c structs? *)
type bind_information = {
seg_ind... | null | https://raw.githubusercontent.com/m4b/rdr/2bf1f73fc317cd74f8c7cacd542889df729bd003/lib/mach/MachImports.ml | ocaml | table of tuples:
<seg-index, seg-offset, type, symbol-library-ordinal, symbol-name, addend>
symbol flags are undocumented
TODO: move the special fields (if any) and match them with what's on disk/in c structs?
seeing self = 0 assuming this means the symbol is imported from itself, because its... libSystem.B... | open Binary
open MachBindOpcodes
open MachLoadCommand
type bind_information = {
seg_index: int;
seg_offset: int;
bind_type: int;
symbol_library_ordinal: int;
symbol_name: string;
symbol_flags: int;
addend: int;
}
type import = {
bi: bind_information;
dylib: string;
is_lazy: bool;
offset: int;
... |
fd927b517a334b0fa4e6c5ba259f94ea59d10016b1ff199a7b2a1c48be5c6499 | typelead/intellij-eta | InstanceSigs00001.hs | # LANGUAGE InstanceSigs #
module InstanceSigs00001 where
data T a = MkT a a
instance Eq a => Eq (T a) where
(==) :: T a -> T a -> Bool -- The signature
(==) (MkT x1 x2) (MkTy y1 y2) = x1==y1 && x2==y2
| null | https://raw.githubusercontent.com/typelead/intellij-eta/ee66d621aa0bfdf56d7d287279a9a54e89802cf9/plugin/src/test/resources/fixtures/eta/sources/InstanceSigs00001.hs | haskell | The signature | # LANGUAGE InstanceSigs #
module InstanceSigs00001 where
data T a = MkT a a
instance Eq a => Eq (T a) where
(==) (MkT x1 x2) (MkTy y1 y2) = x1==y1 && x2==y2
|
24915e17b903bb7f26ce808cc497b6cdcfc0386be28840b9831d7d81e377474a | MLstate/opalang | compilationUtils.ml |
Copyright © 2011 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be useful , ... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/opa/compilationUtils.ml | ocaml | *
Some functions used by compilation passes.
-- |
Copyright © 2011 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be useful , ... |
2cbce2b794b67164dcb65c23f9be24fe7559cf32d5f730f0f4bbbd9b90b270de | mariaschett/ppltr | blk_generator.ml | Copyright 2020 and
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
distr... | null | https://raw.githubusercontent.com/mariaschett/ppltr/67f45f9e329800e6c39094d7c3c3af8d168638da/lib/blk_generator.ml | ocaml | Copyright 2020 and
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
distr... | |
0267fab3cd2a1f66b0cc83f404bac00a443b9c640018b4344fb787e1a6b44992 | melange-re/melange | bsb_path_resolver.ml | open Ext_json_types
let ( // ) = Ext_path.combine
let cache : string Hash_string.t = Hash_string.create 0
let extract_paths_from_importmap cwd json =
match json with
| Obj { map } -> (
match Map_string.find_opt map Bsb_build_schemas.workspace with
| Some (Obj { map }) ->
Map_string.bindings ... | null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/mel/bsb_path_resolver.ml | ocaml | open Ext_json_types
let ( // ) = Ext_path.combine
let cache : string Hash_string.t = Hash_string.create 0
let extract_paths_from_importmap cwd json =
match json with
| Obj { map } -> (
match Map_string.find_opt map Bsb_build_schemas.workspace with
| Some (Obj { map }) ->
Map_string.bindings ... | |
ac1e0f29762d2c86f5c85875456f084ca64701181f7f5a2bc333f9822a64b283 | nd/sicp | 2.41.scm | ;;append-map is the same as flatmap (defined in mzscheme)
(define (triples n s)
(append-map
(lambda (i)
(append-map (lambda (j)
(append-map (lambda (k) (list (list i j k)))
(filter (lambda (k)
(and (not (= i k))
... | null | https://raw.githubusercontent.com/nd/sicp/d8587a0403d95af7c7bcf59b812f98c4f8550afd/ch02/2.41.scm | scheme | append-map is the same as flatmap (defined in mzscheme) |
(define (triples n s)
(append-map
(lambda (i)
(append-map (lambda (j)
(append-map (lambda (k) (list (list i j k)))
(filter (lambda (k)
(and (not (= i k))
(not (= j k))
... |
4e139a20d42f6ec21eaa630b6fa6c49e525154c1fca98b37278bc55fececdb0d | meriken/ju | project.clj | (defproject ju "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:source-paths ["src" "src-cljc"]
:repositories {"4thline.org-repo" ""}
Luminus
[org.clojure/clojure "1.7.0"]
[selmer "0.9.5"]
[markdown-clj "0.9.82"]
[environ "... | null | https://raw.githubusercontent.com/meriken/ju/99caa4625535d3da66002c460bf16d8708cabd7e/project.clj | clojure | not compatible with launch4j
[ring-webjars "0.1.1"]
[org.webjars/bootstrap "3.3.6"]
[org.webjars/jquery "2.1.4"]
[commons-lang/commons-lang "2.6"]
"-server"
"-XX:+UseG1GC" | (defproject ju "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:source-paths ["src" "src-cljc"]
:repositories {"4thline.org-repo" ""}
Luminus
[org.clojure/clojure "1.7.0"]
[selmer "0.9.5"]
[markdown-clj "0.9.82"]
[environ "... |
6103ac72ea83e05567a2c7f7589b1f55aaefe2a43c62d90b6e5c0d98985f9688 | FundingCircle/fc4-framework | test_utils.clj | (ns fc4.test-utils
"Utility functions to integrate clojure.spec.test/check and expound with
clojure.test. Originally inspired by
-Stevcev/dc628109abd840c7553de1c5d7d55608"
(:require [clojure.test :as t :refer [is]]
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :a... | null | https://raw.githubusercontent.com/FundingCircle/fc4-framework/674af39e7edb2cbfd3e1941e6abe80fd87d93bed/test/fc4/test_utils.clj | clojure | TODO: maybe this should be a macro; might improve stack traces (which
currently show the `is` as being in this file, in this fn, because it
is.) | (ns fc4.test-utils
"Utility functions to integrate clojure.spec.test/check and expound with
clojure.test. Originally inspired by
-Stevcev/dc628109abd840c7553de1c5d7d55608"
(:require [clojure.test :as t :refer [is]]
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :a... |
a5234b5574b8ed3b4cb7972fe81f8cb112c12dcaf01bec2f14794ae2c21705ed | haskell-mafia/boris | Data.hs | # LANGUAGE NoImplicitPrelude #
module Boris.Http.Data (
ConfigLocation (..)
, ClientLocale (..)
) where
import Data.Time.Zones (TZ)
import Mismi.S3 (Address)
import P
newtype ConfigLocation =
ConfigLocation {
configLocationAddress :: Address
} deriving (Eq, Show)
... | null | https://raw.githubusercontent.com/haskell-mafia/boris/fb670071600e8b2d8dbb9191fcf6bf8488f83f5a/boris-http/src/Boris/Http/Data.hs | haskell | # LANGUAGE NoImplicitPrelude #
module Boris.Http.Data (
ConfigLocation (..)
, ClientLocale (..)
) where
import Data.Time.Zones (TZ)
import Mismi.S3 (Address)
import P
newtype ConfigLocation =
ConfigLocation {
configLocationAddress :: Address
} deriving (Eq, Show)
... | |
4a7151e8166246d27f09b66b15f3f9f7d91e57ac8d763846b1af85c6d6048778 | matijapretnar/millet | webInterpreter.mli | include WebBackend.S
| null | https://raw.githubusercontent.com/matijapretnar/millet/6d451ad010e602b653116a0bd77a6fb28c2052f9/src/05-backends/interpreter/web/webInterpreter.mli | ocaml | include WebBackend.S
| |
bd729664001f248b5ba9139b35e33c271adb68891e05c1210d86402b7cd0f48f | nunchaku-inria/nunchaku | TypeUnify.ml |
(* This file is free software, part of nunchaku. See file "license" for more details. *)
(** {1 Unification of Types} *)
module TI = TermInner
module TyI = TypePoly
module Subst = Var.Subst
module Loc = Location
let section = Utils.Section.make "unif"
$ inject
let loc = Location.internal
module TI = TermIn... | null | https://raw.githubusercontent.com/nunchaku-inria/nunchaku/16f33db3f5e92beecfb679a13329063b194f753d/src/core/TypeUnify.ml | ocaml | This file is free software, part of nunchaku. See file "license" for more details.
* {1 Unification of Types}
does [var] occur in [ty]?
bound var
NOTE: after dependent types are added, will need to recurse into
types too for unification and occur-check
bound: set of bound variables, that cannot be unifi... |
module TI = TermInner
module TyI = TypePoly
module Subst = Var.Subst
module Loc = Location
let section = Utils.Section.make "unif"
$ inject
let loc = Location.internal
module TI = TermInner
module T = TermTyped . Default
module U = TermTyped . Util(T )
module = Make(T )
let repr = T.rep... |
b101771b97e816410da893791ba83af0741b3663f9f63331f09d3d1b5d58a14a | Kalimehtar/gtk-cffi | color-chooser.lisp | ;;;
color-chooser.lisp -- GtkColorChooser
;;;
Copyright ( C ) 2012 , < >
;;;
(in-package :gtk-cffi)
(defclass color-chooser (object)
())
(defslots color-chooser
rgba prgba
use-alpha :boolean)
(defcfun gtk-color-chooser-add-palette
:void (color-chooser pobject) (orientation orientation)
(color... | null | https://raw.githubusercontent.com/Kalimehtar/gtk-cffi/fbd8a40a2bbda29f81b1a95ed2530debfe2afe9b/gtk/color-chooser.lisp | lisp | color-chooser.lisp -- GtkColorChooser
Copyright ( C ) 2012 , < >
(in-package :gtk-cffi)
(defclass color-chooser (object)
())
(defslots color-chooser
rgba prgba
use-alpha :boolean)
(defcfun gtk-color-chooser-add-palette
:void (color-chooser pobject) (orientation orientation)
(colors-per-line :... | |
f46ba3f50c388167d98cc2480997a4e22db96d39297ea001a1664d1dbacdd899 | airalab/devcon5 | Main.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Main where
import Control.Concurrent (forkIO)
import Control.Concurrent.Chan (newChan)
import Control.Monad.Logger (LoggingT, logDebug, logError,
... | null | https://raw.githubusercontent.com/airalab/devcon5/175ee57a51c828b99a904d90cd889819012a6261/app/Main.hs | haskell | # LANGUAGE OverloadedStrings #
Create log channel
Spawn worker thread
Spawn trader thread
Logging in main thread | # LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Main where
import Control.Concurrent (forkIO)
import Control.Concurrent.Chan (newChan)
import Control.Monad.Logger (LoggingT, logDebug, logError,
logInf... |
2c8b6ce337cf0f5d463ec3a909effc14062e2167014d01cf76589ef90224169f | Kakadu/fp2022 | demoSingle.ml | * Copyright 2022 - 2023 , and contributors
* SPDX - License - Identifier : CC0 - 1.0
open OCamlLabeledArgs_lib
let () = Repl.run_single false
| null | https://raw.githubusercontent.com/Kakadu/fp2022/5365f2f52e3e173cdb052abcfdbfb66fc70fe799/OCamlLabeledArgs/demos/demoSingle.ml | ocaml | * Copyright 2022 - 2023 , and contributors
* SPDX - License - Identifier : CC0 - 1.0
open OCamlLabeledArgs_lib
let () = Repl.run_single false
| |
c5944d1e967c7daad3e47313e1411b8c22d2bb3ed590a65e52fd300ed8383eff | mirage/ocaml-github | github_cookie_jar.mli |
* Copyright ( c ) 2012 Anil Madhavapeddy < >
* Copyright ( c ) 2013 < >
*
* 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-github/429b8751c45d958644bf0e64452bf9b0460955ba/unix/github_cookie_jar.mli | ocaml |
* Copyright ( c ) 2012 Anil Madhavapeddy < >
* Copyright ( c ) 2013 < >
*
* 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 .
*
... | |
403bee31c7e59488b45af50b840bad03ab7efe39fdd79d2647130f554da9210b | icicle-lang/icicle-ambiata | ANormal.hs | -- | A-normalise expressions
-- A-normal form is where the function and arguments of an application
-- can only be simple expressions such as values, variables, and primitives,
-- and let bindings are serialised.
--
-- For example,
--
map ( + ( 5 - 2 ) ) [ 1,2,3 ]
--
-- would end up as something like
--
let a =... | null | https://raw.githubusercontent.com/icicle-lang/icicle-ambiata/9b9cc45a75f66603007e4db7e5f3ba908cae2df2/icicle-data/src/Icicle/Common/Exp/Simp/ANormal.hs | haskell | | A-normalise expressions
A-normal form is where the function and arguments of an application
can only be simple expressions such as values, variables, and primitives,
and let bindings are serialised.
For example,
would end up as something like
let b = (+a)
let c = [1,2,3]
in map b c
Conversion to... | map ( + ( 5 - 2 ) ) [ 1,2,3 ]
let a = 5 - 2
# LANGUAGE NoImplicitPrelude #
module Icicle.Common.Exp.Simp.ANormal (
anormal
, anormalAllVars
) where
import Icicle.Common.Base
import Icicle.Common.Exp.Exp
import Icicle.Common.Exp.Compounds
import Icicle.Common.Fresh
import P
import Data.List (unzi... |
1e0e9bd0e459658b751c4cee527576a4c54d276ccf8605fb8fa455e35f32ac2d | racket/typed-racket | gh-issue-293.rkt | #;
(exn-pred #rx"type mismatch.*expected: Procedure.*given: String")
#lang typed/racket
(define-struct/exec foo ([x : Integer]) ["foo" : String])
| null | https://raw.githubusercontent.com/racket/typed-racket/8b7bd594c66e53beba3d2568ca5ecb28f61c6d96/typed-racket-test/fail/gh-issue-293.rkt | racket | (exn-pred #rx"type mismatch.*expected: Procedure.*given: String")
#lang typed/racket
(define-struct/exec foo ([x : Integer]) ["foo" : String])
| |
d68e42c511d167ff1955d868468c6d32ef00b8b42e906242c45455c04167f59c | ryanpbrewster/haskell | text_to_number.hs | -- text_to_number.hs
- You have a sting which contains a number represented as English text . Your
- task is to translate these numbers into their integer representation . The
- numbers can range from negative 999,999,999 to positive 999,999,999 . The
- following is an exhaustive list of English wor... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/CodeEval/text_to_number.hs | haskell | text_to_number.hs |
- You have a sting which contains a number represented as English text . Your
- task is to translate these numbers into their integer representation . The
- numbers can range from negative 999,999,999 to positive 999,999,999 . The
- following is an exhaustive list of English words that your program ... |
537db2377f3070ae8504127b33355f915cfa0d31101c11776339d70bc71beeda | eponai/sulolive | datascript_test.cljc | (ns eponai.common.datascript_test
(:require [eponai.common.datascript :as project.d]
[datascript.core :as d]
[clojure.test.check :as tc]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop #?@(:cljs [:include-macros true])]
[cloju... | null | https://raw.githubusercontent.com/eponai/sulolive/7a70701bbd3df6bbb92682679dcedb53f8822c18/test/eponai/common/datascript_test.cljc | clojure | create an entity to have something to refer to | (ns eponai.common.datascript_test
(:require [eponai.common.datascript :as project.d]
[datascript.core :as d]
[clojure.test.check :as tc]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop #?@(:cljs [:include-macros true])]
[cloju... |
d0f2b24d1c820b19c0fcd343918738b530d99d3543b01e35ac2b6f880e4441ff | wilkerlucio/pathom | merge.cljc | (ns com.wsscode.pathom.merge
(:require
[com.wsscode.pathom.core :as p]))
NAMESPACE DEPRECATED , use from core
(def merge-queries* p/merge-queries*)
(def merge-queries p/merge-queries)
| null | https://raw.githubusercontent.com/wilkerlucio/pathom/4ec25055d3d156241e9174d68ec438c93c971b9b/src/com/wsscode/pathom/merge.cljc | clojure | (ns com.wsscode.pathom.merge
(:require
[com.wsscode.pathom.core :as p]))
NAMESPACE DEPRECATED , use from core
(def merge-queries* p/merge-queries*)
(def merge-queries p/merge-queries)
| |
70a239d1da679c5e12fb48d666197fd98f3ba64987bae0328cd91bd57ae2c97a | nuvla/ui | zip.cljs | (ns sixsq.nuvla.ui.utils.zip
(:require ["jszip" :as jszip]))
(defn create
[files callback]
(let [zip (jszip)]
(doseq [{:keys [name file]} files]
(.file zip name file))
(-> zip
(.generateAsync #js{"type" "base64", "compression" "STORE"})
(.then #(callback (str "data:application/zip;b... | null | https://raw.githubusercontent.com/nuvla/ui/c10704eabd339489722fa53bc99f11f21103c070/code/src/cljs/sixsq/nuvla/ui/utils/zip.cljs | clojure | (ns sixsq.nuvla.ui.utils.zip
(:require ["jszip" :as jszip]))
(defn create
[files callback]
(let [zip (jszip)]
(doseq [{:keys [name file]} files]
(.file zip name file))
(-> zip
(.generateAsync #js{"type" "base64", "compression" "STORE"})
(.then #(callback (str "data:application/zip;b... | |
64dca5b53008c7423b40a618f6e551d384f5f162e435cd0354062bb529e6aefb | bjorng/wings | wpc_ai.erl | %%
wpc_ai.erl --
%%
Adobe Illustrator ( .ai ) import by
Some updates by
%% For now:
- Only Illustrator version 8 or less files parsed ( v9 - > pdf )
%% - Ignore line width, fill, clip mask, text
%%
%%
%% $Id$
%%
-module(wpc_ai).
-export([init/0,menu/2,command/2,tryimport/2]). % tryimp... | null | https://raw.githubusercontent.com/bjorng/wings/1e2c2d62e93a98c263b167c7a41f8611e0ff08cd/plugins_src/import_export/wpc_ai.erl | erlang |
For now:
- Ignore line width, fill, clip mask, text
$Id$
tryimport is for debugging
exported to wpc_ps wpc_svg_path
all are {x,y} pairs
list of pathops
true or false
pmoveto, plineto, or pcurveto
current path
object list (paths)
skip until after %%EndSetup line, as we currently use nothing before th... | wpc_ai.erl --
Adobe Illustrator ( .ai ) import by
Some updates by
- Only Illustrator version 8 or less files parsed ( v9 - > pdf )
-module(wpc_ai).
-export([findpolyareas/1, polyareas_to_faces/1, subdivide_pas/2]).
-import(lists, [reverse/1,splitwith/2,member/2,
sublist/2,nthtail/2,map/2])... |
5f33a5628156eb3c82f6e4569e47ad74c246e36c9ad93513542c47b5a33f6ac4 | ertugrulcetin/kezban | core.cljc | (ns kezban.core
(:require [clojure.pprint :as pp]
[clojure.walk :as walk]
[clojure.string :as str]
#?(:clj [clojure.java.io :as io]))
#?(:cljs (:require-macros [cljs.core :as core]
[cljs.support :refer [assert-args]]))
#?(:clj (:import
(ja... | null | https://raw.githubusercontent.com/ertugrulcetin/kezban/ea4a3139718bb97c2a879f5161de98a92badb4f4/src/kezban/core.cljc | clojure | used this eval approach because of lack of private function usage in macro!
does not support syntax-quote | (ns kezban.core
(:require [clojure.pprint :as pp]
[clojure.walk :as walk]
[clojure.string :as str]
#?(:clj [clojure.java.io :as io]))
#?(:cljs (:require-macros [cljs.core :as core]
[cljs.support :refer [assert-args]]))
#?(:clj (:import
(ja... |
b97023f436ef71f5dcce3e9dfb90cd9143854e76efe4fb7b3d03fdaa0234cdef | ekmett/profunctors | Unsafe.hs | # LANGUAGE Trustworthy #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE QuantifiedConstraints #
-- |
Copyright : ( C ) 2011 - 2021
-- License : BSD-style (see the file LICENSE)
--
Maintainer : < >
-- Stability : provisional
-- Portability : portable
--
For a good explanation of profunctors in... | null | https://raw.githubusercontent.com/ekmett/profunctors/31cc18dc8da8980efd9e0cb3b31000351bb6ab5c/src/Data/Profunctor/Unsafe.hs | haskell | |
License : BSD-style (see the file LICENSE)
Stability : provisional
Portability : portable
<-in-haskell.html>
This module includes /unsafe/ composition operators that are useful in
If you import this module you are taking upon yourself the obligation
that you will only call the operators with @#@... | # LANGUAGE Trustworthy #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE QuantifiedConstraints #
Copyright : ( C ) 2011 - 2021
Maintainer : < >
For a good explanation of profunctors in Haskell see article :
practice when it comes to generating optimal core in GHC .
module Data.Profunctor.Unsafe
... |
a0fc6ebba69d057734368c29863e103f3d29f0be7e642ec12b2f89e0168c4d6e | sgbj/MaximaSharp | vaxinit.lisp | (setq *gentran-dir ".")
(load "local.gtload.lisp")
| null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/contrib/gentran/vaxinit.lisp | lisp | (setq *gentran-dir ".")
(load "local.gtload.lisp")
| |
f5756031a785bdb5e874845b1740b2acc9fae53ff5995633a159c8cddbc2cae1 | circuithub/haskell-gerber | Mirroring.hs | module Gerber.Mirroring ( Mirroring(..) ) where
data Mirroring
= MirrorNone
| MirrorX
| MirrorY
| MirrorXY
deriving ( Eq, Show )
| null | https://raw.githubusercontent.com/circuithub/haskell-gerber/aa986c2bc67c23f1495de98ee71377752fdb9a16/gerber/lib/Gerber/Mirroring.hs | haskell | module Gerber.Mirroring ( Mirroring(..) ) where
data Mirroring
= MirrorNone
| MirrorX
| MirrorY
| MirrorXY
deriving ( Eq, Show )
| |
639fc01cc9fd4939819e9faff50e041b9350bf6d4a7212737cd7935731a0a3d5 | mbutterick/brag | test-old-token.rkt | #lang racket/base
;; Make sure the old token type also works fine.
(require brag/examples/simple-line-drawing
brag/support
racket/list
br-parser-tools/lex
(prefix-in : br-parser-tools/lex-sre)
rackunit)
(define-tokens tokens (INTEGER STRING |;| EOF))
(define (make-tokeni... | null | https://raw.githubusercontent.com/mbutterick/brag/6c161ae31df9b4ae7f55a14f754c0b216b60c9a6/brag-lib/brag/test/test-old-token.rkt | racket | Make sure the old token type also works fine.
| EOF))
| lexeme)]
Does the rule name "drawing" also have the proper "original?" property set?
FIXME: add tests to make sure location is as we expect.
token. | #lang racket/base
(require brag/examples/simple-line-drawing
brag/support
racket/list
br-parser-tools/lex
(prefix-in : br-parser-tools/lex-sre)
rackunit)
(define (make-tokenizer ip)
(port-count-lines! ip)
(define lex (lexer-src-pos
[(:+ numeric)
... |
0f140a98e409b19e8607ea2b16d175bd393d9622dfcd219901ea88c590ee83a6 | metabase/metabase | alert_test.clj | (ns metabase.api.alert-test
"Tests for `/api/alert` endpoints."
(:require
[clojure.test :refer :all]
[medley.core :as m]
[metabase.email-test :as et]
[metabase.http-client :as client]
[metabase.models
:refer [Card Collection Pulse PulseCard PulseChannel PulseChannelRecipient]]
[metabase.models... | null | https://raw.githubusercontent.com/metabase/metabase/3b8f0d881c19c96bfdff95a275440db97b1e0173/test/metabase/api/alert_test.clj | clojure | +----------------------------------------------------------------------------------------------------------------+
| Helper Fns & Macros |
+--------------------------------------------------------------------------------------... | (ns metabase.api.alert-test
"Tests for `/api/alert` endpoints."
(:require
[clojure.test :refer :all]
[medley.core :as m]
[metabase.email-test :as et]
[metabase.http-client :as client]
[metabase.models
:refer [Card Collection Pulse PulseCard PulseChannel PulseChannelRecipient]]
[metabase.models... |
f91d3a72e2d0c0f9d8441713a7a5335d9381d5260cc63c3c789b65de3c49353e | robert-strandh/Second-Climacs | io.lisp | (cl:in-package #:second-climacs-clim-base)
(defmethod esa-buffer:frame-make-buffer-from-stream ((frame climacs) stream)
(multiple-value-bind (buffer cursor)
(base:make-empty-standard-buffer-and-cursor)
(base:fill-buffer-from-stream cursor stream)
buffer))
(defmethod esa-buffer:frame-save-buffer-to-str... | null | https://raw.githubusercontent.com/robert-strandh/Second-Climacs/64826221fdbc9c615d61917bcafd0917e72c8673/Code/GUI/McCLIM-ESA/io.lisp | lisp | For some reason, write-file gives a string rather than a pathname
to the default method of this generic function. | (cl:in-package #:second-climacs-clim-base)
(defmethod esa-buffer:frame-make-buffer-from-stream ((frame climacs) stream)
(multiple-value-bind (buffer cursor)
(base:make-empty-standard-buffer-and-cursor)
(base:fill-buffer-from-stream cursor stream)
buffer))
(defmethod esa-buffer:frame-save-buffer-to-str... |
fd323b85a534ddb6e9f2bbdf58103f0475beab28debe7065089377e1ec6d7bfd | cpeikert/ALCHEMY | Common.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE NoImplicitPrelude #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE PolyKinds #
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamili... | null | https://raw.githubusercontent.com/cpeikert/ALCHEMY/adbef64576c6f6885600da66f59c5a4ad91810b7/examples/Common.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
a concrete Z_{2^e} data type
plaintext ring indices
corresponding ciphertext ring indices
H1 * F13 * F5
H2 * F5 * F3
H3 * F5 * F3
H5 * F5
... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE PartialTypeSignatures #
# LANGUAGE PolyKinds #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - partial - type - signatures #
module Common where
import Control.DeepSeq
import Control.Monad.IO.Class
import... |
99d6d0fe49bde0276485ec5c65849d3345d3ed22ce458a63b93f2836de6916bd | facebookarchive/pfff | graph_code_ml.ml |
*
* Copyright ( C ) 2012 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file licens... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_ml/analyze/graph_code_ml.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
***************************************************************************
Types
**************************************************************************... |
*
* Copyright ( C ) 2012 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file licens... |
1e8ae7363540a91084684f863719b97d9ed5cba4ffe4e11a963a388954a88938 | swarmpit/swarmpit | activate.cljs | (ns swarmpit.component.stack.activate
(:require [material.icon :as icon]
[material.components :as comp]
[material.component.form :as form]
[material.component.composite :as composite]
[swarmpit.component.editor :as editor]
[swarmpit.component.state :as state... | null | https://raw.githubusercontent.com/swarmpit/swarmpit/38ffbe08e717d8620bf433c99f2e85a9e5984c32/src/cljs/swarmpit/component/stack/activate.cljs | clojure | (ns swarmpit.component.stack.activate
(:require [material.icon :as icon]
[material.components :as comp]
[material.component.form :as form]
[material.component.composite :as composite]
[swarmpit.component.editor :as editor]
[swarmpit.component.state :as state... | |
1a7c6cf228fbbb99f0e706426fe2395416ee3c00b9768be45ebc449589b12c18 | elastic/eui-cljs | icon_index_edit.cljs | (ns eui.icon-index-edit
(:require ["@elastic/eui/lib/components/icon/assets/index_edit.js" :as eui]))
(def indexEdit eui/icon)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/icon_index_edit.cljs | clojure | (ns eui.icon-index-edit
(:require ["@elastic/eui/lib/components/icon/assets/index_edit.js" :as eui]))
(def indexEdit eui/icon)
| |
55953bdffb11065bcbde6db6f03588fa95ac85dbf6e4dac0543affeea82f6aed | sibylfs/sibylfs_src | fs_test_util.ml | (****************************************************************************)
Copyright ( c ) 2013 , 2014 , 2015 , , , ,
( as part of the SibylFS project )
(* *)
(* Permission to use, copy, modify, and/or d... | null | https://raw.githubusercontent.com/sibylfs/sibylfs_src/30675bc3b91e73f7133d0c30f18857bb1f4df8fa/fs_test/lib/fs_test_util.ml | ocaml | **************************************************************************
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright no... | Copyright ( c ) 2013 , 2014 , 2015 , , , ,
( as part of the SibylFS project )
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL
PROFITS , WHETHER IN AN ACTION OF CONTRACT , NEGLIGENCE OR OTHER
TORTIOUS ACTION , ARISING OUT OF OR IN CONNE... |
05e274788adfac1796865335d4ef8a50752616853dd4db3f4fd22bcf1e4d427a | bugarela/GADTInference | e2.hs | data T a where {TInt :: (a ~ Bool) => Int -> T a; TAny :: T a}
e = \x -> case x of {TInt n -> (n > 0);TAny -> True}
-- T t -> Bool
| null | https://raw.githubusercontent.com/bugarela/GADTInference/dd179f6df2cd76055c25c33da3187a60815688d1/examples/inferred/e2.hs | haskell | T t -> Bool | data T a where {TInt :: (a ~ Bool) => Int -> T a; TAny :: T a}
e = \x -> case x of {TInt n -> (n > 0);TAny -> True}
|
566e0c9dd3551418218ca9e6507d18d50993d14d7a5f00c3215ad7859b990f4b | tonyg/kali-scheme | memory2.scm | Copyright ( c ) 1993 , 1994 and . See file COPYING .
; An implementation of Pre-Scheme's memory interface that can detect some
; stray reads and writes. It has numerous limitiations:
; Allocations are always on page boundaries.
; No more than 16 megabytes can be allocated at once.
More than 32 or 6... | null | https://raw.githubusercontent.com/tonyg/kali-scheme/79bf76b4964729b63fce99c4d2149b32cb067ac0/scheme/prescheme/memory2.scm | scheme | An implementation of Pre-Scheme's memory interface that can detect some
stray reads and writes. It has numerous limitiations:
Allocations are always on page boundaries.
No more than 16 megabytes can be allocated at once.
bignums (dealloctions have no effect on this).
Memory is represented as a vecto... | Copyright ( c ) 1993 , 1994 and . See file COPYING .
More than 32 or 64 or so allocations result in addresses being
representing a 16 - megabyte page . Allocations are always made on page
Memory is one big vector , with markers at beginning and end of free blocks
and allocationg by by address ord... |
0ff4e82a11d283c56b4b33771476e79dca78dabaf3fdc20beb04e1db49d8b456 | csabahruska/jhc-components | Supply.hs | module Fixer.Supply(
Supply(),
newSupply,
supplyReadValues,
sValue,
readSValue,
supplyValue
) where
import Control.Monad.Trans
import Data.IORef
import Data.Typeable
import Fixer.Fixer
import qualified Data.Map as Map
-- maps b's to values of a's, creating them as needed.
data Supply b a ... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/jhc-common/src/Fixer/Supply.hs | haskell | maps b's to values of a's, creating them as needed.
# UNPACK # | module Fixer.Supply(
Supply(),
newSupply,
supplyReadValues,
sValue,
readSValue,
supplyValue
) where
import Control.Monad.Trans
import Data.IORef
import Data.Typeable
import Fixer.Fixer
import qualified Data.Map as Map
deriving(Typeable)
newSupply :: MonadIO m => Fixer -> m (Supply b ... |
d8d7260d4710ebbc878ad03dde2b77efbe4535dcd48029943afd2dd758a48443 | cedlemo/OCaml-GObject-Introspection | Property_info.mli |
* Copyright 2017 - 2019 ,
* This file is part of OCaml - GObject - Introspection .
*
* OCaml - GObject - Introspection is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 o... | null | https://raw.githubusercontent.com/cedlemo/OCaml-GObject-Introspection/261c76d9e5d90f706edff1121a63bf5eb611399b/lib/Property_info.mli | ocaml | * Property_info — Struct representing a property
* Obtain the type information for the property info .
* Obtain the flags for this property info. See GParamFlags for more
information about possible flag values.
* Add unref of the C underlying structure whith Gc.finalise.
* Return a Property_info.t from a Base_i... |
* Copyright 2017 - 2019 ,
* This file is part of OCaml - GObject - Introspection .
*
* OCaml - GObject - Introspection is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 o... |
8f1493688344474ee6e179ecdceba81ea0235bbe36141bdd99ad9ff8eaf903ed | onedata/op-worker | qos_entry_audit_log.erl | %%%-------------------------------------------------------------------
@author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
This module is responsible for stor... | null | https://raw.githubusercontent.com/onedata/op-worker/34607258e1b3fca71a1b0da2a0bc5f0134fe878e/src/modules/datastore/models/qos/qos_entry_audit_log.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
===================================================================
API
===================... | @author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
This module is responsible for storing audit log of QoS operations on files .
The audit log stores logs concerning all files affected by a specific QoS entry .
-module(qos_entry_audit_log).
-aut... |
7c303bc72b6bcb492856f02d5a8d7a72098580cc10612d3c1077420588ff5772 | metosin/reitit | middleware.clj | (ns example.middleware
(:require [muuntaja.middleware]
[ring.middleware.params]
[reitit.middleware :as middleware]
[reitit.ring.coercion :as rrc]))
unlift Middleware Record into vanilla Ring middleware
(defn wrap-coercion [handler resource]
(middleware/chain
[rrc/coerce-ex... | null | https://raw.githubusercontent.com/metosin/reitit/1ab075bd353966636f154ac36ae9b7990efeb008/examples/just-coercion-with-ring/src/example/middleware.clj | clojure | (ns example.middleware
(:require [muuntaja.middleware]
[ring.middleware.params]
[reitit.middleware :as middleware]
[reitit.ring.coercion :as rrc]))
unlift Middleware Record into vanilla Ring middleware
(defn wrap-coercion [handler resource]
(middleware/chain
[rrc/coerce-ex... | |
da364c7672e5c6900e4b1ede79b71ea0adfa1c63213273c93f6e9cfb6512da9e | arsalan0c/cdp-hs | CDP.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
module CDP
( Error (..)
, ProtocolError (..)
, EPBrowserVersion (..)
, EPAllTargets (..)
, EPCurrentProtocol (..)
, EPOpenNewTab (..)
, EPActivateTarget (..)
, EPCloseTarget (..)
, EPFronte... | null | https://raw.githubusercontent.com/arsalan0c/cdp-hs/7aca1d366ad63d81d5d681220e0637a8551034de/src/CDP.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
module CDP
( Error (..)
, ProtocolError (..)
, EPBrowserVersion (..)
, EPAllTargets (..)
, EPCurrentProtocol (..)
, EPOpenNewTab (..)
, EPActivateTarget (..)
, EPCloseTarget (..)
, EPFronte... | |
ed76be40b70b7534d4769c0927014a7fc8c5a63e4997db53da1fcb4d6ec1180e | mikeizbicki/HLearn | example0003-classification.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE RebindableSyntax #
# LANGUAGE DataKinds #
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE RankNTypes #-}
import SubHask
import SubHask.Algebra.Array
import SubHask.Algebra.Vector
import SubHask.Algebra.Container
import HLearn.Data.LoadData
impor... | null | https://raw.githubusercontent.com/mikeizbicki/HLearn/c6c0f5e7593be3867f20c56c79b998e7d7ded9fc/examples/example0003-classification.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE RankNTypes #
------------------------------------------------------------------------------
putStrLn "" | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE RebindableSyntax #
# LANGUAGE DataKinds #
import SubHask
import SubHask.Algebra.Array
import SubHask.Algebra.Vector
import SubHask.Algebra.Container
import HLearn.Data.LoadData
import HLearn.Classifiers.Linear
import HLearn.History
import qua... |
e5207fc88a7f118783c5ad21560165508e344b179a2215a584e1d124ba88c9f8 | shayne-fletcher/zen | ml_lexer.ml | # 1 "ml_lexer.mll"
(**The lexical analyzer*)
open Lexing
open Ml_parser
* { 2 Utilities }
(**Update the current location with file name and line
number. [absolute] if [false] means add [line] to the current line
number, if [true], replace it with [line] entirely*)
let update_loc
(lexbuf : lexb... | null | https://raw.githubusercontent.com/shayne-fletcher/zen/10a1d0b9bf261bb133918dd62fb1593c3d4d21cb/ocaml/cos/src/parsing/ml_lexer.ml | ocaml | *The lexical analyzer
*Update the current location with file name and line
number. [absolute] if [false] means add [line] to the current line
number, if [true], replace it with [line] entirely
*[create_hashtable size init] creates a hashtable with [size] buckets
with initial contents [init]
*[keyword_table] as... | # 1 "ml_lexer.mll"
open Lexing
open Ml_parser
* { 2 Utilities }
let update_loc
(lexbuf : lexbuf)
(file : string option)
(line : int)
(absolute : bool)
(chars :int) : unit =
let pos = lexbuf.lex_curr_p in
let new_file =
match file with
| None -> pos.pos_fname
... |
2d1c6fab685ff65d3ebe2ea48b4f350cc4d11255f3e849475a1986bc46f75845 | bzuilhof/AdventOfCode | day12.hs | module Day12 where
import Data.List
import Data.Char
import Data.Maybe
import Data.Array
type Pot = Char
inputData, iD :: [Pot]
inputData = "#...#..###.#.###.####.####.#..#.##..#..##..#.....#.#.#.##.#...###.#..##..#.##..###..#..##.#..##..."
iD = replicate (length inputData) '.' ++ inputData ++ replicate (length inpu... | null | https://raw.githubusercontent.com/bzuilhof/AdventOfCode/e6ff762c1c766e028fb90ef62b8f4dc4adf9ecc1/2018/day12.hs | haskell | failed attempt in finding a loop | module Day12 where
import Data.List
import Data.Char
import Data.Maybe
import Data.Array
type Pot = Char
inputData, iD :: [Pot]
inputData = "#...#..###.#.###.####.####.#..#.##..#..##..#.....#.#.#.##.#...###.#..##..#.##..###..#..##.#..##..."
iD = replicate (length inputData) '.' ++ inputData ++ replicate (length inpu... |
d27b68037d304e581660323e20e04e5e6c287c00593d33391503bb2994797f4d | jscl-project/jscl | closette.lisp | -*-Mode : LISP ; Package : ( CLOSETTE : USE LISP ) ; ; Syntax : Common - lisp -*-
;;;
Closette Version 1.0 ( February 10 , 1991 )
;;;
Minor revisions of September 27 , 1991 by :
;;; - remove spurious "&key" in header of initialize-instance method
;;; for standard-class (bottom of pg.310 of AMOP)
;;; - add... | null | https://raw.githubusercontent.com/jscl-project/jscl/d38eec2aeb47d04f1caf3d1cda82dc968d67c305/src/clos/closette/closette.lisp | lisp | Package : ( CLOSETTE : USE LISP ) ; ; Syntax : Common - lisp -*-
- remove spurious "&key" in header of initialize-instance method
for standard-class (bottom of pg.310 of AMOP)
- add recommendation about not compiling this file
- by default, efunctuate methods rather than compile them
- also make m... | Closette Version 1.0 ( February 10 , 1991 )
Minor revisions of September 27 , 1991 by :
- change comment to reflect PARC ftp server name change
- add a BOA constructor to std - instance to please AKCL
Copyright ( c ) 1990 , 1991 Xerox Corporation .
software or derivative works must comply with all ap... |
66c493612727f802309baf85b8d8b3dc5309256dd87c901e30e0b61d33d0ba45 | mflatt/scope-sets | define-example.rkt | #lang scheme
(require redex/reduction-semantics)
(provide define-example-definer)
(define-syntax-rule (define-example-definer define-example
mini wrap parser empty-ctx)
(begin
(...
(define-metafunction mini
as-syntax : any -> val
[(as-syntax nam) (Stx (Sym nam) empty-c... | null | https://raw.githubusercontent.com/mflatt/scope-sets/4d3ae9d8a0f6ff83aa597612d280406cb6d82f5b/model/define-example.rkt | racket | #lang scheme
(require redex/reduction-semantics)
(provide define-example-definer)
(define-syntax-rule (define-example-definer define-example
mini wrap parser empty-ctx)
(begin
(...
(define-metafunction mini
as-syntax : any -> val
[(as-syntax nam) (Stx (Sym nam) empty-c... | |
d556fcb8789cfd3d75d6fe6e9440377f559bc9aa225e01c52a7a9947eec5ed95 | re-ops/re-core | re_conf.clj | (ns re-mote.repl.re-conf
"Running re-conf recpies on hosts"
(:require
[clojure.string :refer (join)]
[re-mote.ssh.pipeline :refer (run-hosts)]
[pallet.stevedore :refer (script)]
re-mote.repl.base)
(:import [re_mote.repl.base Hosts]))
(defprotocol ReConf
(apply-recipes
[this path args]
[this... | null | https://raw.githubusercontent.com/re-ops/re-core/93596efd4f3068d57e8140106da60011a6569310/src/re_mote/repl/re_conf.clj | clojure | (ns re-mote.repl.re-conf
"Running re-conf recpies on hosts"
(:require
[clojure.string :refer (join)]
[re-mote.ssh.pipeline :refer (run-hosts)]
[pallet.stevedore :refer (script)]
re-mote.repl.base)
(:import [re_mote.repl.base Hosts]))
(defprotocol ReConf
(apply-recipes
[this path args]
[this... | |
660057972cf57921ae9d0b1fbcd9820e8f2e271cc00798e0fc7ae8ade725a4d5 | hjcapple/reading-sicp | exercise_3_65.scm | #lang racket
P235 - [ 练习 3.65 ]
(require "stream.scm")
(require "infinite_stream.scm")
(require "stream_iterations.scm")
(require "exercise_3_55.scm") ; for partial-sums
(define (ln2-summands n)
(cons-stream (/ 1.0 n)
(stream-map - (ln2-summands (+ n 1)))))
; 原始流定义
(define ln2-stream
(partial-s... | null | https://raw.githubusercontent.com/hjcapple/reading-sicp/7051d55dde841c06cf9326dc865d33d656702ecc/chapter_3/exercise_3_65.scm | scheme | for partial-sums
原始流定义
欧拉加速
超级加速器
ln2 的精确值为 0.693147180559945309417232121458176568075500134360255254120...
采用超级加速的 ln2-stream-3 收敛速度更快, | #lang racket
P235 - [ 练习 3.65 ]
(require "stream.scm")
(require "infinite_stream.scm")
(require "stream_iterations.scm")
(define (ln2-summands n)
(cons-stream (/ 1.0 n)
(stream-map - (ln2-summands (+ n 1)))))
(define ln2-stream
(partial-sums (ln2-summands 1)))
(define ln2-stream-2
(euler-tra... |
aa691e07f30e449c5f90b68e01b80107462c389fbc748ead26bf697a49788b82 | lemenkov/rtplib | codec_speex_test.erl | %%%----------------------------------------------------------------------
Copyright ( c ) 2008 - 2012 < >
%%%
%%% All rights reserved.
%%%
%%% Redistribution and use in source and binary forms, with or without modification,
%%% are permitted provided that the following conditions are met:
%%%
%%% * Redistributions... | null | https://raw.githubusercontent.com/lemenkov/rtplib/b74a43b41fdb3dcdac6e33c5f2b9196780f7cbc8/test/codec_speex_test.erl | erlang | ----------------------------------------------------------------------
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
... | Copyright ( c ) 2008 - 2012 < >
DISCLAIMED . IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;
ANY THEORY OF LIABILITY , WHETHER IN ... |
b1c9a8d383b93bdf371921083560e93315b565372f549536d3f3ce621446ba74 | ctford/Idris-Elba-Dev | Delaborate.hs | # LANGUAGE PatternGuards #
module Idris.Delaborate (bugaddr, delab, delab', delabMV, delabTy, delabTy', pshow, pprintErr) where
Convert core TT back into high level syntax , primarily for display
-- purposes.
import Util.Pretty
import Idris.AbsSyntax
import Idris.Core.TT
import Idris.Core.Evaluate
import Idris.Er... | null | https://raw.githubusercontent.com/ctford/Idris-Elba-Dev/e915e1d6b7a5921ba43d2572a9ad9b980619b8ee/src/Idris/Delaborate.hs | haskell | purposes.
^ implicit arguments to type, if any
^ use full names
^ Don't treat metavariables specially
just one thing
metavariables have no implicits
| How far to indent sub-errors
| Actually indent a sub-error - no line at end because a newline can end
multiple layers of indent
just one thing | # LANGUAGE PatternGuards #
module Idris.Delaborate (bugaddr, delab, delab', delabMV, delabTy, delabTy', pshow, pprintErr) where
Convert core TT back into high level syntax , primarily for display
import Util.Pretty
import Idris.AbsSyntax
import Idris.Core.TT
import Idris.Core.Evaluate
import Idris.ErrReverse
imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.