_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 |
|---|---|---|---|---|---|---|---|---|
7342bcc1f0d7aebe6290b871e2cdb537ccf4a25f30fbfbdb88104f137ba15f5b | spurious/chibi-scheme-mirror | full.scm |
(define (char-alphabetic? ch) (char-set-contains? char-set:letter ch))
(define (char-lower-case? ch) (char-set-contains? char-set:lower-case ch))
(define (char-upper-case? ch) (char-set-contains? char-set:upper-case ch))
(define (char-numeric? ch) (char-set-contains? char-set:digit ch))
(define (char-whitespace? ch) (... | null | https://raw.githubusercontent.com/spurious/chibi-scheme-mirror/49168ab073f64a95c834b5f584a9aaea3469594d/lib/scheme/char/full.scm | scheme |
(define (char-alphabetic? ch) (char-set-contains? char-set:letter ch))
(define (char-lower-case? ch) (char-set-contains? char-set:lower-case ch))
(define (char-upper-case? ch) (char-set-contains? char-set:upper-case ch))
(define (char-numeric? ch) (char-set-contains? char-set:digit ch))
(define (char-whitespace? ch) (... | |
a13a587ba0fccfae646ccb1b2ed9dd3d3529cf4fb82709cec8213fe2e1bc9ce8 | bennn/iPoe | yes.rkt | #lang ipoe/english-sonnet
shall I compare thee to a summer day?
thou art more lovely and more temperate.
rough wind do shake the darling bud of May,
and summer lease hath all too short template.
sometime too hot the eye of heaven shine,
and often is his gold complexion dim
and every fair from fair sometime decline,
b... | null | https://raw.githubusercontent.com/bennn/iPoe/4a988f6537fb738b4fe842c404f9d78f658ab76f/examples/english-sonnet/yes.rkt | racket | #lang ipoe/english-sonnet
shall I compare thee to a summer day?
thou art more lovely and more temperate.
rough wind do shake the darling bud of May,
and summer lease hath all too short template.
sometime too hot the eye of heaven shine,
and often is his gold complexion dim
and every fair from fair sometime decline,
b... | |
a02ff1c119c2f4efe90b7831c18f9c98e1ad94618a87a3a120311a4801beb9ff | titola/incudine | jack.lisp | Copyright ( c ) 2013 - 2020
;;;
;;; 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 ; either version 2 of the License , or
;;; (at your option) any later version.
;;;
;;; This program is distri... | null | https://raw.githubusercontent.com/titola/incudine/325174a54a540f4daa67bcbb29780073c35b7b80/src/jack.lisp | lisp |
This program is free software; you can redistribute it and/or modify
either version 2 of the License , or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR... | Copyright ( c ) 2013 - 2020
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
Foundation , Inc. , 51 Franklin St , Fifth Floor , Boston , MA 02110 - 1301 USA
(in-package :incudine.external)
(cffi:defcstruct rt-xrun
(c... |
0bda21c8c3133729a324b13003d54ef676692dfe7e8408d4cfc393b05aa2ed1e | elastic/eui-cljs | icon_editor_item_align_center.cljs | (ns eui.icon-editor-item-align-center
(:require ["@elastic/eui/lib/components/icon/assets/editorItemAlignCenter.js" :as eui]))
(def editorItemAlignCenter eui/icon)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/icon_editor_item_align_center.cljs | clojure | (ns eui.icon-editor-item-align-center
(:require ["@elastic/eui/lib/components/icon/assets/editorItemAlignCenter.js" :as eui]))
(def editorItemAlignCenter eui/icon)
| |
5c6b298069ea4581a0707e6fcca600bade83e5d3772f824fec61bed75a9c3ff9 | semerdzhiev/fp-2020-21 | class.rkt | #lang racket
;; (define slavi-info '(
( age 28 )
( name " Slavi Boyanov " )
( age 27 )
( birth - place " " )
;; )
;; )
(define (make-multiset . values)
props = = ' ( ) = > , props = = ' ( value left r... | null | https://raw.githubusercontent.com/semerdzhiev/fp-2020-21/64fa00c4f940f75a28cc5980275b124ca21244bc/group-a/Week8-OpenRec/class.rkt | racket | (define slavi-info '(
)
)
4 8 15 16 23 42
4 7 8 15 16 23 42
4 8 15 16 23 42
4 15 16 23 42
4 8 15 16 23 42
#t
#f
4 8 15 16 23 42 | #lang racket
( age 28 )
( name " Slavi Boyanov " )
( age 27 )
( birth - place " " )
(define (make-multiset . values)
props = = ' ( ) = > , props = = ' ( value left right )
(define empty (null? props))
(define (value... |
de5a2057ebd7842f5de6c2995a28b3c80920b3e958c33037950636af8c7f3238 | jimpil/duratom | scoped_counter_example.clj | (ns duratom.scoped-counter-example
(:require [duratom.core :as core]
[clojure.test :refer :all]))
;; Requirement:
;==============
; A set of identifiable services need to generate unique, monotonically increasing, numeric ids within some range,
; and be able to survive a restart/crash at any given point... | null | https://raw.githubusercontent.com/jimpil/duratom/3633f1c709ed18d75491eef6919899ee3dda8939/test/duratom/scoped_counter_example.clj | clojure | Requirement:
==============
A set of identifiable services need to generate unique, monotonically increasing, numeric ids within some range,
and be able to survive a restart/crash at any given point in time. Sort of like a distributed counter.
The mental burden of providing a large enough range (to avoid duplicates... | (ns duratom.scoped-counter-example
(:require [duratom.core :as core]
[clojure.test :refer :all]))
(defn- mock-service [i]
{:id (str "SERVICE_" i)})
(def DB-SPEC {:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname "//localhost:5432/atomDB"
... |
8f2db591abfaf3325ac45befa7743ac792b2c01cbead835e8bde8cae074f2c17 | nick8325/equinox | PSequence.hs | module Equinox.PSequence where
Equinox -- Copyright ( c ) 2003 - 2007 , is hereby granted , free of charge , to any person obtaining a
copy of this software and associated documentation files ( the
" Software " ) , to deal in the Software without restriction , including
without limitation the rights to use... | null | https://raw.githubusercontent.com/nick8325/equinox/67351fbc4358fdea931b4c1dfb659f5527b40917/Haskell/Equinox/PSequence.hs | haskell | Copyright ( c ) 2003 - 2007 , is hereby granted , free of charge , to any person obtaining a
Copyright (c) 2003-2007, Koen Claessen
sortBy cmp
steal queues
putStr ("<p" ++ show k ++ " steals ")
let ys = xs
putStr (show (length ys2) ++ ">") | module Equinox.PSequence where
copy of this software and associated documentation files ( the
" Software " ) , to deal in the Software without restriction , including
without limitation the rights to use , copy , modify , merge , publish ,
distribute , sublicense , and/or sell copies of the Software , and to
... |
7151a6092a4f315efb91bd6cf28bbe9ec9aae514b70841b5420fa556f0cda5b0 | cushon/project-euler | 81.rkt | #lang racket
(require "common.rkt")
; Find the minimal path sum in a matrix from the top left to the
; bottom right by only moving right and down.
(define (solve)
(define matrix
(map (lambda (x) (map string->number (csv->lst x)))
(file->lines "81.txt")))
(define (chop lsts n)
(define (h lst... | null | https://raw.githubusercontent.com/cushon/project-euler/d7fcbfff0cd59b2c3691293ff35bb2043b409f68/81.rkt | racket | Find the minimal path sum in a matrix from the top left to the
bottom right by only moving right and down. | #lang racket
(require "common.rkt")
(define (solve)
(define matrix
(map (lambda (x) (map string->number (csv->lst x)))
(file->lines "81.txt")))
(define (chop lsts n)
(define (h lsts procd acc n)
(if (or (zero? n) (empty? lsts))
(list
(reverse acc)
(appe... |
f3b71d3e16d5e411c06167f0163378b090e3c421dc2651f629495dc4b57672c8 | ozusrl/SubtypedQuotedML | simpleEnv.mli | (*********************************************************************************************************************)
(* *)
... | null | https://raw.githubusercontent.com/ozusrl/SubtypedQuotedML/7b09eb5518dea21fda3dc9db3b966a17225d91ff/src/toy/simpleEnv.mli | ocaml | *******************************************************************************************************************
... |
, projet Cristal , INRIA Rocquencourt
Copyright 2000 Institut National de Recherche en Informatique et Automatique . Distributed only by per... |
3c1454564f6774c3c24b294b6469c1af8f382101affb9bba765fc68bca48077a | runtimeverification/haskell-backend | Signedness.hs | module Test.Kore.Builtin.Signedness (
test_verify,
test_match,
test_unify,
) where
import Kore.Internal.Condition qualified as Condition
import Kore.Internal.Pattern (
Pattern,
)
import Kore.Internal.Pattern qualified as Pattern
import Kore.Internal.Substitution (
Assignment,
)
import Kore.Intern... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/f2c86d14fcc67aaa580b9913f9bccbc56c5281a3/kore/test/Test/Kore/Builtin/Signedness.hs | haskell | module Test.Kore.Builtin.Signedness (
test_verify,
test_match,
test_unify,
) where
import Kore.Internal.Condition qualified as Condition
import Kore.Internal.Pattern (
Pattern,
)
import Kore.Internal.Pattern qualified as Pattern
import Kore.Internal.Substitution (
Assignment,
)
import Kore.Intern... | |
0be9443922775570b7e00f3bebace660eb682cebe26791926aebd34087661d34 | ggreif/omega | Datatype.hs | # LANGUAGE TemplateHaskell , ViewPatterns , KindSignatures , DataKinds , RankNTypes , GADTs , ScopedTypeVariables , FlexibleInstances , StandaloneDeriving #
# LANGUAGE DatatypeContexts #
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
for ghc 7.8
-- GOAL: transform (simple) TH datatype splices to the f... | null | https://raw.githubusercontent.com/ggreif/omega/016a3b48313ec2c68e8d8ad60147015bc38f2767/mosaic/th-symantics/Datatype.hs | haskell | GOAL: transform (simple) TH datatype splices to the format of level-aware inhabitants
this needs DatatypeContexts
inh :: repr (S l) -> (repr l -> repr l) -> repr l
should be
FOR NOW!
deriving
- FOR NOW!
TODO: tyvars should be "outer" and constructors should be "inner" | # LANGUAGE TemplateHaskell , ViewPatterns , KindSignatures , DataKinds , RankNTypes , GADTs , ScopedTypeVariables , FlexibleInstances , StandaloneDeriving #
# LANGUAGE DatatypeContexts #
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
for ghc 7.8
ex = [d| data Foo = A | B (Foo :: *) deriving Show |]
... |
e9880b6053620c65e9dd8853e40418154d290c5b379a3732b071c59392463140 | owlbarn/owl_opt | rmsprop_d.ml | module Make = Rmsprop.Make (Owl.Algodiff.D)
| null | https://raw.githubusercontent.com/owlbarn/owl_opt/c3b34072dddbce2d70e1698c5f1fd84d783f9cef/src/opt/rmsprop/rmsprop_d.ml | ocaml | module Make = Rmsprop.Make (Owl.Algodiff.D)
| |
dec113a7070b15fdb9aa006b0acdd8299a6251bb054778d7e4dfc2f1bc044207 | rudymatela/speculate | list.hs | import QuickSpec
main = quickSpec signature
{ maxTermSize = Just 5
, maxTermDepth = Just 4
, maxTests = Just 500
, constants =
[ constant "[]" ([] :: [Int])
, constant ":" ((:) :: Int -> [Int] -> [Int])
, constant "++" ((++) :: [Int] -> [Int] -> [Int])
, constant "head" (head :: [Int] ... | null | https://raw.githubusercontent.com/rudymatela/speculate/8ec39747d03033db4349d554467d4b78bb72935d/bench/qs2/list.hs | haskell | import QuickSpec
main = quickSpec signature
{ maxTermSize = Just 5
, maxTermDepth = Just 4
, maxTests = Just 500
, constants =
[ constant "[]" ([] :: [Int])
, constant ":" ((:) :: Int -> [Int] -> [Int])
, constant "++" ((++) :: [Int] -> [Int] -> [Int])
, constant "head" (head :: [Int] ... | |
476a3036f36a2e638fd4e8014dab21b35b47f204fec20e90ce04b911f19ecb96 | mark-watson/lisp_practical_semantic_web | encode.lisp | This file is part of yason , a Common Lisp JSON parser / encoder
;;
Copyright ( c ) 2008
;; All rights reserved.
;;
;; Please see the file LICENSE in the distribution.
(in-package :yason)
(defvar *json-output*)
(defgeneric encode (object &optional stream)
(:documentation "Encode OBJECT to STREAM in JSON for... | null | https://raw.githubusercontent.com/mark-watson/lisp_practical_semantic_web/2d9d5bb06b574ab0bff15664fe747a5b99e1fb1b/utils/yason/encode.lisp | lisp |
All rights reserved.
Please see the file LICENSE in the distribution. | This file is part of yason , a Common Lisp JSON parser / encoder
Copyright ( c ) 2008
(in-package :yason)
(defvar *json-output*)
(defgeneric encode (object &optional stream)
(:documentation "Encode OBJECT to STREAM in JSON format. May be
specialized by applications to perform specific rendering. STREAM
... |
340125deab5b4548401630c940e7767fa31e095b086aa900e8e3f11c031bbd4e | gregorycollins/hashtables | Basic.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
{-# LANGUAGE MagicHash #-}
|
A basic open - addressing hash table using linear probing . Use this hash table if
you ...
* want the fastest possible lookups , and very fast inserts .
* do n't care about wasting a little bit of memory to get it .... | null | https://raw.githubusercontent.com/gregorycollins/hashtables/2af160445b75571110c6c36d00df84aac5276234/src/Data/HashTable/ST/Basic.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE MagicHash #
so the overhead for a full slot is at least one quarter word -- but
so the overhead for a full slot is at least one quarter word -- but
----------------------------------------------------------------------------
----------------------------------------------------... | # LANGUAGE CPP #
|
A basic open - addressing hash table using linear probing . Use this hash table if
you ...
* want the fastest possible lookups , and very fast inserts .
* do n't care about wasting a little bit of memory to get it .
* do n't care that a table resize might pause for a lo... |
c4822840ae4c6b02b6fd4090dd9959b4330d0a61e8d5a918ee2d1e9466f0a9e2 | saman-pasha/LCC | package.lisp | (in-package :cl-user)
(defpackage :lcc
(:use :cl)
(:export
:compile-ast
:compile-lcc-file))
| null | https://raw.githubusercontent.com/saman-pasha/LCC/00087c057676469fc6d6467de0ea563e1967af21/package.lisp | lisp | (in-package :cl-user)
(defpackage :lcc
(:use :cl)
(:export
:compile-ast
:compile-lcc-file))
| |
10258080323100434adf8fc75436ff9d79299c12605cd741b1093e4dfa331f39 | RDTK/generator | ros-package.lisp | ;;;; ros-package.lisp --- Analysis of ROS packages.
;;;;
Copyright ( C ) 2013 - 2019 Jan Moringen
;;;;
Author : < >
;;;; Partially based on
;;;; -infrastructure/rep/blob/master/rep-0140.rst
(cl:in-package #:build-generator.analysis)
(define-constant +ros-package-name+ "package/name/text()"
:test #'string=
... | null | https://raw.githubusercontent.com/RDTK/generator/8d9e6e47776f2ccb7b5ed934337d2db50ecbe2f5/src/analysis/ros-package.lisp | lisp | ros-package.lisp --- Analysis of ROS packages.
Partially based on
-infrastructure/rep/blob/master/rep-0140.rst
Conversion helpers | Copyright ( C ) 2013 - 2019 Jan Moringen
Author : < >
(cl:in-package #:build-generator.analysis)
(define-constant +ros-package-name+ "package/name/text()"
:test #'string=
:documentation
"Name of the package. Required.")
(define-constant +ros-package-version+ "package/version/text()"
:test #'string=
... |
08f163672550d0b46913d79c8b1ed11d26a68713e82b2cefccd48e4c55424bf2 | austinhaas/kanren | case_inf_plus.clj | (ns pettomato.kanren.rKanren.case-inf-plus
(:require
[pettomato.kanren.rKanren.streams :refer [mzero? rdelay? unit? choice?]]
[pettomato.kanren.rKanren.rank :refer [inc-rank]]))
(defmacro case-inf+
[e _ e0 [f'] e1 [a'] e2 [a f] e3]
`(let [a# ~e]
(cond
(mzero? a#) (inc-rank ~e0)
(rdelay? a... | null | https://raw.githubusercontent.com/austinhaas/kanren/f55b68279ade01dbaae67a074ea3441370a27f9e/src/pettomato/kanren/rKanren/case_inf_plus.clj | clojure | (ns pettomato.kanren.rKanren.case-inf-plus
(:require
[pettomato.kanren.rKanren.streams :refer [mzero? rdelay? unit? choice?]]
[pettomato.kanren.rKanren.rank :refer [inc-rank]]))
(defmacro case-inf+
[e _ e0 [f'] e1 [a'] e2 [a f] e3]
`(let [a# ~e]
(cond
(mzero? a#) (inc-rank ~e0)
(rdelay? a... | |
2ea04af98a9bfc8e1583e68a2f350c4c58adb26b29ddd425cbfcf0b2b8e7ceec | ucsd-progsys/liquidhaskell | Inconsistent1.hs | @ LIQUID " --expect - error - containing = Specified type does not refine type for ` Inconsistent1.incr ` ( Checked ) " @
module Inconsistent1 where
{-@ incr :: Int -> Bool @-}
incr :: Int -> Int
incr x = x + 1
| null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/errors/Inconsistent1.hs | haskell | @ incr :: Int -> Bool @ | @ LIQUID " --expect - error - containing = Specified type does not refine type for ` Inconsistent1.incr ` ( Checked ) " @
module Inconsistent1 where
incr :: Int -> Int
incr x = x + 1
|
e96acc808ce74a94b420b87ce4e0b6864d39643397db0780ebbde12d77b42903 | grzm/uri-template | uri_template.clj | (ns com.grzm.uri-template
(:require
[clojure.walk :as walk]
[com.grzm.uri-template.impl :as impl]))
(set! *warn-on-reflection* true)
(defn expand
[template variables]
(try
(let [parsed (impl/parse template)]
(if (impl/anomaly? parsed)
(cond-> parsed
impl/*omit-state?* (dissoc p... | null | https://raw.githubusercontent.com/grzm/uri-template/cb817cfa6eda2b20ca9834b687f543b1927c025d/src/com/grzm/uri_template.clj | clojure | (ns com.grzm.uri-template
(:require
[clojure.walk :as walk]
[com.grzm.uri-template.impl :as impl]))
(set! *warn-on-reflection* true)
(defn expand
[template variables]
(try
(let [parsed (impl/parse template)]
(if (impl/anomaly? parsed)
(cond-> parsed
impl/*omit-state?* (dissoc p... | |
97e6effeefe1a4fe877d9ed4a4f64c7335bd344499db4998b9fcb5695d2d1f41 | BekaValentine/SimpleFP | Elaboration.hs | {-# OPTIONS -Wall #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE TypeSynonymInstances #-}
module Poly.Unification.Elaboration where
import Control.Applicative ((<$>),(<*>))
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad.State
import Abs
import Scope
i... | null | https://raw.githubusercontent.com/BekaValentine/SimpleFP/3cff456be9f0b99509e5cbe809be1055009b32df/src/Poly/Unification/Elaboration.hs | haskell | # OPTIONS -Wall #
# LANGUAGE TypeSynonymInstances # | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Poly.Unification.Elaboration where
import Control.Applicative ((<$>),(<*>))
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad.State
import Abs
import Scope
import TypeChecker (extendDefinitions)
import Poly.Core.Abst... |
d00a927da62953355b44892ed0d26e3d734d37260e3c186094744db116a041a3 | janestreet/bonsai | controls.mli | open! Core
open! Import
type t =
{ size : int
; stroke_width : float
; stroke : [ `Hex of string ]
; fill : [ `Hex of string ] option
}
(** The part on the right where you can control the size/color/etc. of all the icons. *)
val component : (t * Vdom.Node.t) Computation.t
| null | https://raw.githubusercontent.com/janestreet/bonsai/d42f19ba7fd17b8363408f11da181a3812fa6c81/examples/feather_icons/controls.mli | ocaml | * The part on the right where you can control the size/color/etc. of all the icons. | open! Core
open! Import
type t =
{ size : int
; stroke_width : float
; stroke : [ `Hex of string ]
; fill : [ `Hex of string ] option
}
val component : (t * Vdom.Node.t) Computation.t
|
8df1e026a4a78fd4f47b6fe89dcea6a427bbe342c09d4d9cfe286bdba5b145cc | mmcqd/datatt | ctx.ml | open Core
module Dom = Domain
module Syn = Syntax
type entry =
| Def of {tm : Dom.t ; tp : Dom.t}
| Let of {tm : Dom.t ; tp : Dom.t}
| Var of Dom.t
| Data of Dom.desc
type t = entry String.Map.t
let empty = String.Map.empty
let to_env : t -> Dom.Env.t = String.Map.mapi ~f:(fun ~key ~data ->
match data... | null | https://raw.githubusercontent.com/mmcqd/datatt/3810a3f390417a48cee7bab6e46ee08783986326/src/ctx.ml | ocaml | open Core
module Dom = Domain
module Syn = Syntax
type entry =
| Def of {tm : Dom.t ; tp : Dom.t}
| Let of {tm : Dom.t ; tp : Dom.t}
| Var of Dom.t
| Data of Dom.desc
type t = entry String.Map.t
let empty = String.Map.empty
let to_env : t -> Dom.Env.t = String.Map.mapi ~f:(fun ~key ~data ->
match data... | |
866575984dc35683b92521c6643c6a3cb2003bc1c0ae850eaf7f72fdd68d2720 | fukamachi/safety-params | assertions.lisp | (defpackage #:safety-params/assertions
(:use #:cl
#:safety-params/errors)
(:import-from #:safety-params/errors
#:unpermitted-keys-keys
#:not-satisfied-key-key
#:not-satisfied-key-message
#:missing-required-keys-keys)
(:import-from #:safety-pa... | null | https://raw.githubusercontent.com/fukamachi/safety-params/13e30916dfce130a6b35c22cd7969a9cba20a8f0/src/assertions.lisp | lisp | (defpackage #:safety-params/assertions
(:use #:cl
#:safety-params/errors)
(:import-from #:safety-params/errors
#:unpermitted-keys-keys
#:not-satisfied-key-key
#:not-satisfied-key-message
#:missing-required-keys-keys)
(:import-from #:safety-pa... | |
c765e504c21e0526ca640b14257ffb33966c6c002ac16d466e205a8eb05c712a | rbkmoney/erlang_capi_v2 | capi_bender.erl | -module(capi_bender).
-include_lib("bender_proto/include/bender_thrift.hrl").
-include_lib("bender_proto/include/msgpack_thrift.hrl").
-type id() :: binary().
-type idempotent_key_prefix() :: binary() | atom().
-type external_id() :: binary().
-type issuer_id() :: dmsl_domain_thrift:'PartyID'() | dmsl_payment_process... | null | https://raw.githubusercontent.com/rbkmoney/erlang_capi_v2/8381da653aa1e3dd8242b50efe50ce522b2064c1/apps/capi/src/capi_bender.erl | erlang | -type identity_schema() :: feat:schema().
deprecated
TODO(ED-287): (see above)
Private
If external ID is undefined, no reason to generate it: noone can really use it
Deprecated idempotent context | -module(capi_bender).
-include_lib("bender_proto/include/bender_thrift.hrl").
-include_lib("bender_proto/include/msgpack_thrift.hrl").
-type id() :: binary().
-type idempotent_key_prefix() :: binary() | atom().
-type external_id() :: binary().
-type issuer_id() :: dmsl_domain_thrift:'PartyID'() | dmsl_payment_process... |
38c2724a60d3cd86f1d31a9476fae23e0a3039468a9dc56edba6daec73a6632d | incoherentsoftware/defect-process | All.hs | module Player.Overlay.All
( PlayerOverlays(..)
, mkPlayerOverlays
) where
import Control.Monad.IO.Class (MonadIO)
import FileCache
import Player.Overlay.All.GrindSparks
import Player.Overlay.All.GroundFriction
import Player.Overlay.Types
import Window.Graphics
mkPlayerOverlays :: (FileCache m, GraphicsRe... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/15f2569e7d0e481c2e28c0ca3a5e72d2c049b667/src/Player/Overlay/All.hs | haskell | module Player.Overlay.All
( PlayerOverlays(..)
, mkPlayerOverlays
) where
import Control.Monad.IO.Class (MonadIO)
import FileCache
import Player.Overlay.All.GrindSparks
import Player.Overlay.All.GroundFriction
import Player.Overlay.Types
import Window.Graphics
mkPlayerOverlays :: (FileCache m, GraphicsRe... | |
bc1c66d2637de5968eb245c8f3a7d3d90e62575ea4bf7a254127753bdd654976 | skroutz/clj-skroutz | shops.clj | (ns clj_skroutz.shops
"Implements shop endpoints."
(:use [clj_skroutz.core :refer [api-call]]))
(defn shop
"Gets a shop.
/#retrieve-a-single-shop"
[id & options]
(api-call :get "shops/%s" [id] options))
(defn reviews
"Lists shop's reviews.
/#retrieve-a-shops-reviews"
[id & options]
(api-call :... | null | https://raw.githubusercontent.com/skroutz/clj-skroutz/25c6c32f5ac8d5ea082ef4dbede6720f74d15ef0/src/clj_skroutz/shops.clj | clojure | (ns clj_skroutz.shops
"Implements shop endpoints."
(:use [clj_skroutz.core :refer [api-call]]))
(defn shop
"Gets a shop.
/#retrieve-a-single-shop"
[id & options]
(api-call :get "shops/%s" [id] options))
(defn reviews
"Lists shop's reviews.
/#retrieve-a-shops-reviews"
[id & options]
(api-call :... | |
191fc81ecf2b1729480d7cad469cee91fd21461a495d528ce9c7c2a7e727e5db | jeovazero/hello-haskell-nix | User.hs | # LANGUAGE DuplicateRecordFields #
# LANGUAGE ExistentialQuantification #
# LANGUAGE NamedFieldPuns #
module Lib.Domain.User (
addUser,
verifyUserCredentials
) where
import qualified Control.Exception as C
import Data.Password.Argon2 as Argon
import Data.Text (Text)
import Data.UUID (UUID)
import Database.Post... | null | https://raw.githubusercontent.com/jeovazero/hello-haskell-nix/8b2be5c31a381dffda79d0a73fbf5ac06487b5f4/src/Lib/Domain/User.hs | haskell | using the default parameters
-3.0.0.0/docs/src/Data.Password.Argon2.html#defaultParams | # LANGUAGE DuplicateRecordFields #
# LANGUAGE ExistentialQuantification #
# LANGUAGE NamedFieldPuns #
module Lib.Domain.User (
addUser,
verifyUserCredentials
) where
import qualified Control.Exception as C
import Data.Password.Argon2 as Argon
import Data.Text (Text)
import Data.UUID (UUID)
import Database.Post... |
7c8027eae837d971abb68709358570d0503d39afcdf05bed138900654ee00250 | startalkIM/ejabberd | meck.erl | %%%============================================================================
Copyright 2011
%%%
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 ... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/deps/meck/src/meck.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 expr... | Copyright 2011
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
2011 , Adam Lindberg & Erlang Solutions Ltd
@doc Module mocking library for Erlang .
-module(meck).
-export_type([matcher/0]).
-e... |
24128016af869ca82d77a5a337beeaed012c6e669ca6497a903e9a3c269eaaca | coq/coq | constr.mli | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/b1e4aceed9837edf9c62776b11c2b8dc1d26040b/kernel/constr.mli | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
b2a7c7445c952434e1a3e3352e794763a2f7c93fd92b67529a96c2baacdd34fa | liquidz/antq | download.clj | (ns antq.download
(:require
[antq.util.git :as u.git]
[clojure.tools.deps :as deps]
[clojure.tools.deps.util.maven :as mvn]))
(defmulti dep->deps-map :type)
(defmethod dep->deps-map :default [_] nil)
(defmethod dep->deps-map :java
[dep]
{(symbol (:name dep)) {:mvn/version (:latest-version dep)}})
(de... | null | https://raw.githubusercontent.com/liquidz/antq/4a4fb5e61ddb2f3400e18bdd5c856ca4f04cdfd7/src/antq/download.clj | clojure | (ns antq.download
(:require
[antq.util.git :as u.git]
[clojure.tools.deps :as deps]
[clojure.tools.deps.util.maven :as mvn]))
(defmulti dep->deps-map :type)
(defmethod dep->deps-map :default [_] nil)
(defmethod dep->deps-map :java
[dep]
{(symbol (:name dep)) {:mvn/version (:latest-version dep)}})
(de... | |
3d50d0e70384e00c0bae7dd83c3a9bce99b29240adfb62b9a5a1374cc159a30f | ekmett/linear | Projection.hs | # LANGUAGE CPP #
---------------------------------------------------------------------------
-- |
Copyright : ( C ) 2015
-- License : BSD-style (see the file LICENSE)
--
Maintainer : < >
-- Stability : experimental
-- Portability : non-portable
--
-- Common projection matrices: e.g. perspecti... | null | https://raw.githubusercontent.com/ekmett/linear/9bb5d69d25f96dd338769f81927d5101b90663af/src/Linear/Projection.hs | haskell | -------------------------------------------------------------------------
|
License : BSD-style (see the file LICENSE)
Stability : experimental
Portability : non-portable
Common projection matrices: e.g. perspective/orthographic transformation
matrices.
Analytically derived inverses are also supplied... | # LANGUAGE CPP #
Copyright : ( C ) 2015
Maintainer : < >
module Linear.Projection
( lookAt
, perspective, inversePerspective
, infinitePerspective, inverseInfinitePerspective
, frustum, inverseFrustum
, ortho, inverseOrtho
) where
import Control.Lens hiding (index)
import Linear.V3
import... |
f9a33cc1fd14ec1a91351d3b4ba281960f8d1be5b90c00ec65ed14e89aaaa47d | haskell/text | Throughput.hs | -- | This benchmark simply reads and writes a file using the various string
-- libraries. The point of it is that we can make better estimations on how
much time the other benchmarks spend doing IO .
--
Note that we expect ByteStrings to be a whole lot faster , since they do not
do any actual encoding / decoding ... | null | https://raw.githubusercontent.com/haskell/text/ca73ae38ed3744ec930cbfdb706147ec29d5a185/benchmarks/haskell/Benchmarks/Programs/Throughput.hs | haskell | | This benchmark simply reads and writes a file using the various string
libraries. The point of it is that we can make better estimations on how
encoding/decoding.
Tested in this benchmark:
* Reading the file
* Replacing text between HTML tags (<>) with whitespace
* Writing back to a handle
| much time the other benchmarks spend doing IO .
Note that we expect ByteStrings to be a whole lot faster , since they do not
do any actual encoding / decoding here , while String and Text do have UTF-8
module Benchmarks.Programs.Throughput
( benchmark
) where
import Test.Tasty.Bench (Benchmark, bgroup, b... |
dbde7fb346244ef279bdb0a341d021e33529736a6f3c7ec46180a332f0d26640 | geophf/1HaskellADay | Solution.hs | {-# LANGUAGE OverloadedStrings #-}
module Y2018.M04.D17.Solution where
-
So , yesterday we had a bunch of JSON from various periodicals , but they were
all in the same JSON format , which made it simple to upload them into a common
database .
Today , we have JSON , but in a different format , that we need to... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2018/M04/D17/Solution.hs | haskell | # LANGUAGE OverloadedStrings #
}
The articles are in this directory:
and the files are:
parse in the vice articles then save them to the articles database.
-}
with the above readVices function, you should be able to call main'' and go!
} |
module Y2018.M04.D17.Solution where
-
So , yesterday we had a bunch of JSON from various periodicals , but they were
all in the same JSON format , which made it simple to upload them into a common
database .
Today , we have JSON , but in a different format , that we need to upload into
that database , so ,... |
90f53690dae145275aa6f19649e1b88d096af4c176b00ece303fa6cf1e06cdd6 | willghatch/rackterm | terminal-canvas.rkt | #lang racket/base
(require racket/gui/base)
(require racket/class)
(require racket/dict)
(require "terminal.rkt")
(require "term-key-event.rkt")
(provide terminal-canvas%
map-char-event-to-term-key-event
)
;;; YARR!!! Here be the ugliest code in the whole project! This file is a mess!
;;; TODO:
;... | null | https://raw.githubusercontent.com/willghatch/rackterm/5d94185dea482974a1cf66099380bede6c2ce501/rackterm/private/terminal-canvas.rkt | racket | YARR!!! Here be the ugliest code in the whole project! This file is a mess!
TODO:
- clean this crap up
- do key input mapping (arrow keys, etc)
- do cursor better...
- make it faster -- currently if anything on a line is different I redraw the line.
I really should just redraw any cells that are different ins... | #lang racket/base
(require racket/gui/base)
(require racket/class)
(require racket/dict)
(require "terminal.rkt")
(require "term-key-event.rkt")
(provide terminal-canvas%
map-char-event-to-term-key-event
)
- add customization to set the 16 color palette map , input mapping
(define the-char-bitm... |
1dd8cf49962fe14e88ec0d79e457305249b4f063910aa5a42a97afa321be4125 | VitorCBSB/HetrisV2 | Help.hs | {-# LANGUAGE OverloadedStrings #-}
module Help
( inputHelp,
tickHelp,
renderHelp,
)
where
import Constants (windowSize)
import Control.Lens
import Control.Monad (forM_)
import InitialStates (initialMainMenuState)
import qualified SDL
import Types
import UtilsSDL (renderText, renderTextCentered)
inputHelp... | null | https://raw.githubusercontent.com/VitorCBSB/HetrisV2/2544e8ce56a4d0daba9126642118f0504215f742/app/Help.hs | haskell | # LANGUAGE OverloadedStrings # |
module Help
( inputHelp,
tickHelp,
renderHelp,
)
where
import Constants (windowSize)
import Control.Lens
import Control.Monad (forM_)
import InitialStates (initialMainMenuState)
import qualified SDL
import Types
import UtilsSDL (renderText, renderTextCentered)
inputHelp :: SDL.EventPayload -> IO MainStat... |
16303c04d167ae29de627d1fe494a47883e945619ba1d13d53f6741ddb062ae2 | macourtney/Conjure | links_sidebar.clj | (ns views.layouts.templates.links-sidebar
(:use conjure.view.base)
(:require [conjure.util.conjure-utils :as conjure-utils]
[conjure.util.request :as request]
[views.layouts.templates.links :as links]))
(defn
#^{ :doc "Creates a list link for use in the link sidebar." }
list-link [layout-... | null | https://raw.githubusercontent.com/macourtney/Conjure/1d6cb22d321ea75af3a6abe2a5bc140ad36e20d1/conjure_flow/test/views/layouts/templates/links_sidebar.clj | clojure | (ns views.layouts.templates.links-sidebar
(:use conjure.view.base)
(:require [conjure.util.conjure-utils :as conjure-utils]
[conjure.util.request :as request]
[views.layouts.templates.links :as links]))
(defn
#^{ :doc "Creates a list link for use in the link sidebar." }
list-link [layout-... | |
c247e3176e13a4076750d4d939507f29a48b74d72fdb84d144029dfe705556c1 | runtimeverification/haskell-backend | Strategy.hs | # OPTIONS_GHC -fno - warn - name - shadowing #
# OPTIONS_GHC -fno - warn - orphans #
module Test.Kore.Rewrite.Strategy (
prop_depthLimit,
prop_pickLongest,
prop_pickFinal,
prop_pickOne,
prop_pickStar,
prop_pickPlus,
) where
import Control.Exception qualified as Exception
import Control.Monad.C... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/c1da545ee7aebf4e686912f70720a74c245cf652/kore/test/Test/Kore/Rewrite/Strategy.hs | haskell | | @n@ | # OPTIONS_GHC -fno - warn - name - shadowing #
# OPTIONS_GHC -fno - warn - orphans #
module Test.Kore.Rewrite.Strategy (
prop_depthLimit,
prop_pickLongest,
prop_pickFinal,
prop_pickOne,
prop_pickStar,
prop_pickPlus,
) where
import Control.Exception qualified as Exception
import Control.Monad.C... |
8c767d8e8fa744610761e67a73ab4262b784e9e8bbef68ceafdbb20a78f93abb | txyyss/Project-Euler | Euler015.hs | Starting in the top left corner of a 2 * 2 grid , there are 6 routes
-- (without backtracking) to the bottom right corner.
How many routes are there through a 20 * 20 grid ?
module Euler015 where
routesCount :: Integral a => a -> a -> a
routesCount m n = product [(m + 1)..(m + n)] `div` product [2..n]
result015... | null | https://raw.githubusercontent.com/txyyss/Project-Euler/d2f41dad429013868445c1c9c1c270b951550ee9/Euler015.hs | haskell | (without backtracking) to the bottom right corner. | Starting in the top left corner of a 2 * 2 grid , there are 6 routes
How many routes are there through a 20 * 20 grid ?
module Euler015 where
routesCount :: Integral a => a -> a -> a
routesCount m n = product [(m + 1)..(m + n)] `div` product [2..n]
result015 = routesCount 20 20
|
94ee74ea860186e1f3b3f8fc8a21617bbd06b54d3f5046727c379b7d54313f9d | grin-compiler/ghc-wpc-sample-programs | AbsSyntaxTree.hs | |
Module : . AbsSyntaxTree
Description : Core data definitions used in .
License : : The Idris Community .
Module : Idris.AbsSyntaxTree
Description : Core data definitions used in Idris.
License : BSD3
Maintainer : The Idris Community.
-}
# LANGUAGE CPP , DeriveDataTypeable , , D... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/idris-1.3.3/src/Idris/AbsSyntaxTree.hs | haskell | | Data to pass to recursively called elaborators; e.g. for where blocks,
paramaterised declarations, etc.
rec_elabDecl is used to pass the top level elaborator into other elaborators,
so that we can have mutually recursive elaborators in separate modules without
having to muck about with cyclic modules.
^ names ... | |
Module : . AbsSyntaxTree
Description : Core data definitions used in .
License : : The Idris Community .
Module : Idris.AbsSyntaxTree
Description : Core data definitions used in Idris.
License : BSD3
Maintainer : The Idris Community.
-}
# LANGUAGE CPP , DeriveDataTypeable , , D... |
1812c595c62f1ec3f047871d8fb0a3a92addc497bebf903a5368d56d1fc994b8 | BrunoBonacci/1config | oneconfig_test.clj | (ns com.brunobonacci.oneconfig-test
(:refer-clojure :exclude [find load list])
(:require [midje.sweet :refer :all]
[com.brunobonacci.oneconfig.backend :refer :all]
[com.brunobonacci.oneconfig.backends.encoding
:refer [make-encoding-wrapper]]
[com.brunobonacci.on... | null | https://raw.githubusercontent.com/BrunoBonacci/1config/4cf8284b1b490253ac617bec9d2348c3234931e6/1config-core/test/com/brunobonacci/oneconfig_test.clj | clojure | (ns com.brunobonacci.oneconfig-test
(:refer-clojure :exclude [find load list])
(:require [midje.sweet :refer :all]
[com.brunobonacci.oneconfig.backend :refer :all]
[com.brunobonacci.oneconfig.backends.encoding
:refer [make-encoding-wrapper]]
[com.brunobonacci.on... | |
a867775df48cdac43e19034fecbbc689f9a3948e0ff38e1422af92cfac08d435 | qiao/sicp-solutions | 2.61.scm | (define (element-of-set? x set)
(cond ((null? set) false)
((= x (car set)) true)
((< x (car set)) false)
(else (element-of-set? x (cdr set)))))
(define (intersection-set set1 set2)
(if (or (null? set1) (null? set2))
'()
(let ((x1 (car set1))
(x2 (car set2)))
... | null | https://raw.githubusercontent.com/qiao/sicp-solutions/a2fe069ba6909710a0867bdb705b2e58b2a281af/chapter2/2.61.scm | scheme | (define (element-of-set? x set)
(cond ((null? set) false)
((= x (car set)) true)
((< x (car set)) false)
(else (element-of-set? x (cdr set)))))
(define (intersection-set set1 set2)
(if (or (null? set1) (null? set2))
'()
(let ((x1 (car set1))
(x2 (car set2)))
... | |
ae20546e5fa5f177b529ed13f2760eb059a8b70db05d842335bc65cb0a464a6e | dgiot/dgiot | emqx_packet.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2017 - 2022 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 o... | null | https://raw.githubusercontent.com/dgiot/dgiot/c601555e45f38d02aafc308b18a9e28c543b6f2c/src/emqx_packet.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 ) 2017 - 2022 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_packet).
-include("emqx.hrl").
-include("emqx_mqtt.hrl").
-export([ type/1
... |
11bfec74420c9315c6593a6f657ee9e5fb36286331be4664c134a7524bfee60e | cardano-foundation/dab | ChainWatcher.hs |
module ChainWatcher where
import Control.Concurrent
import Control.Concurrent.Async
import Control.Concurrent.STM
import Control.Lens
import Control.Monad
import Control.Monad.Freer
import Control.Monad.Freer.AcidState
import Control.Monad.Freer.Error
import Control.Monad.Freer.Fresh
import Control.Monad.Freer.Log
im... | null | https://raw.githubusercontent.com/cardano-foundation/dab/b650c175254dc9d013ebe970aecb4f9124d6d2e2/chain-watcher/src/ChainWatcher.hs | haskell | in case that the one we get from getLatestBlock disappears
due to nested writer
look up the address holding the utxo so we can track it in block processing loop
find previous existing block and rollback to it
onRollback
Process new blocks
this whole thing shouldn't produce events until it fully succeeds
so we r... |
module ChainWatcher where
import Control.Concurrent
import Control.Concurrent.Async
import Control.Concurrent.STM
import Control.Lens
import Control.Monad
import Control.Monad.Freer
import Control.Monad.Freer.AcidState
import Control.Monad.Freer.Error
import Control.Monad.Freer.Fresh
import Control.Monad.Freer.Log
im... |
7dca7a09dfcc7398e14fb067390399ace06f0356e591f82e164e5d806b007efb | jubnzv/moonsmith | errors.ml | exception ConfigError of string
exception InternalError of string
| null | https://raw.githubusercontent.com/jubnzv/moonsmith/d392afac8b8dbd51385dda7a437deba0850e113a/src/errors.ml | ocaml | exception ConfigError of string
exception InternalError of string
| |
392047d362121867ea0d78997a670dce26d5f3744d9fc537f201aba193ffbb48 | ocaml-omake/omake | omake_command.mli | (*
* Argument parser.
*)
type arg_buffer
val arg_buffer_empty : arg_buffer
val arg_buffer_add_string : arg_buffer -> string -> arg_buffer
val arg_buffer_add_data : arg_buffer -> string -> arg_buffer
val arg_buffer_contents : arg_buffer -> Omake_command_type.arg_string list
* commands .
* Parse comm... | null | https://raw.githubusercontent.com/ocaml-omake/omake/08b2a83fb558f6eb6847566cbe1a562230da2b14/src/ir/omake_command.mli | ocaml |
* Argument parser.
* Add the output flag.
| type arg_buffer
val arg_buffer_empty : arg_buffer
val arg_buffer_add_string : arg_buffer -> string -> arg_buffer
val arg_buffer_add_data : arg_buffer -> string -> arg_buffer
val arg_buffer_contents : arg_buffer -> Omake_command_type.arg_string list
* commands .
* Parse commands.
*)
val parse_command... |
a27111149220db276f3ca047f0a6680c05ebe8f284e96fddac82f8487360edc8 | DevExpress/gimp-dx-screenshot | dx-pointer.scm | (define (script-fu-dx-pointerv2 image
drawable
drop-shadow
pointer-type
shadow-distance
shadow-angle
shadow-blur
shadow-colo... | null | https://raw.githubusercontent.com/DevExpress/gimp-dx-screenshot/a691687e24b18ce8d0c6d0ec78933bcd56ae3492/dx-pointer.scm | scheme | (type (car (gimp-drawable-type-with-alpha drawable)))
(gimp-image-resize-to-layers image)
(car (gimp-image-get-active-layer image))
(car (gimp-image-get-active-layer image))
| (define (script-fu-dx-pointerv2 image
drawable
drop-shadow
pointer-type
shadow-distance
shadow-angle
shadow-blur
shadow-colo... |
092d7b02d757a0eb1c109c4658878db135996817be65c6a4e03a23ab5197a030 | jamis/rtc-ocaml | chap12.ml | open RTCComposition
let solid r g b = RTCPattern.Solid (RTCColor.build r g b)
let color = RTCColor.build
let scene () =
let floor_ceiling =
let cube = RTCCube.build () in
let transform = compose [ Translate (0., 1., 0.); Scale (20., 7., 20.) ] in
let material =
let pattern =
let c1 = solid... | null | https://raw.githubusercontent.com/jamis/rtc-ocaml/f5ba04e874ef0b54d100cdabfe9a67c2b80a643f/progs/chap12.ml | ocaml | open RTCComposition
let solid r g b = RTCPattern.Solid (RTCColor.build r g b)
let color = RTCColor.build
let scene () =
let floor_ceiling =
let cube = RTCCube.build () in
let transform = compose [ Translate (0., 1., 0.); Scale (20., 7., 20.) ] in
let material =
let pattern =
let c1 = solid... | |
c473449e2c2424b484347cafc658cf343ae17b1f8631b97148d4c4f0ecb2c112 | larcenists/larceny | macros.scm | ; macros.scm - Sassy's macro system
Copyright ( C ) 2005
; This library 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.1 of the License , or ( at your option ) any later versio... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/src/Lib/Sassy/macros.scm | scheme | macros.scm - Sassy's macro system
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNE... | Copyright ( C ) 2005
version 2.1 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin St , Fifth Floor , Boston , MA 02110 - 1301 USA
Sunnyside , NY 11104
see file COPYING in the top of Sass... |
38e4cbd0c0b2f7d9d9aa872c82a9f7be4112638e38e9f337130b586efb83b4bc | kronkltd/jiksnu | index_components.cljs | (ns jiksnu.app.components.index-components
(:require [jiksnu.app :refer [jiksnu]]
[jiksnu.app.helpers :as helpers]
[jiksnu.registry :as registry]))
(doseq [[page-name] registry/page-mappings]
(helpers/page-controller jiksnu page-name))
| null | https://raw.githubusercontent.com/kronkltd/jiksnu/8c91e9b1fddcc0224b028e573f7c3ca2f227e516/src-cljs/jiksnu/app/components/index_components.cljs | clojure | (ns jiksnu.app.components.index-components
(:require [jiksnu.app :refer [jiksnu]]
[jiksnu.app.helpers :as helpers]
[jiksnu.registry :as registry]))
(doseq [[page-name] registry/page-mappings]
(helpers/page-controller jiksnu page-name))
| |
078a2faeed1c49cfe06b0e9b0c70f4d7a3548f5b83086d09620a2268663afa48 | c-cube/ocaml-containers | CCLock.ml | (* This file is free software, part of containers. See file "license" for more details. *)
* { 1 Utils around Mutex }
type 'a t = { mutex: Mutex.t; mutable content: 'a }
type 'a lock = 'a t
let create content = { mutex = Mutex.create (); content }
let with_lock l f =
Mutex.lock l.mutex;
try
let x = f l.cont... | null | https://raw.githubusercontent.com/c-cube/ocaml-containers/69f2805f1073c4ebd1063bbd58380d17e62f6324/src/threads/CCLock.ml | ocaml | This file is free software, part of containers. See file "license" for more details. |
* { 1 Utils around Mutex }
type 'a t = { mutex: Mutex.t; mutable content: 'a }
type 'a lock = 'a t
let create content = { mutex = Mutex.create (); content }
let with_lock l f =
Mutex.lock l.mutex;
try
let x = f l.content in
Mutex.unlock l.mutex;
x
with e ->
Mutex.unlock l.mutex;
raise e
l... |
0f42cb4b94082ffa6e543f628e603f517120a3ff0db313577220abb9ba04d1bc | corecursive/sicp-study-group | ex02_47.scm | * Exercise 2.47 :* Here are two possible constructors for frames :
;;
( define ( make - frame origin )
( list origin ) )
;;
( define ( make - frame origin )
;; (cons origin (cons edge1 edge2)))
;;
;; For each constructor supply the appropriate selectors to p... | null | https://raw.githubusercontent.com/corecursive/sicp-study-group/be350bf06bb0f546b1bb03733681fc671fcefc7a/plundaahl/exercises/ex02_47.scm | scheme |
(cons origin (cons edge1 edge2)))
For each constructor supply the appropriate selectors to produce an
implementation for frames.
TESTS (same tests for both versions) | * Exercise 2.47 :* Here are two possible constructors for frames :
( define ( make - frame origin )
( list origin ) )
( define ( make - frame origin )
VERSION 1
(define (make-frame origin edge1 edge2)
(list origin edge1 edge2))
(define (origin-frame frame) (car frame... |
5258128af53dedc2c878d261e44cabe2e10aaf27d23319138a79679273a3274e | emqx/emqx | emqx_authn_mongo_SUITE.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2023 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 o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx_authn/test/emqx_authn_mongo_SUITE.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 - 2023 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_authn_mongo_SUITE).
-compile(nowarn_export_all).
-compile(export_all).
-include_l... |
8acbc03850d4abdd3a4f1e5452a784f3122785bcca4ae4e04eb43fa359383482 | CloudI/CloudI | hackney_trace.erl | %%%% -*- erlang -*-
This file is part of hackney released under the Apache 2 license .
%%%% See the NOTICE for more information.
-module(hackney_trace).
-export([enable/2, disable/0,
set_level/1,
report_event/4]).
-type trace_level() :: max | min | integer().
-type filename() :: string().
-type trace_type() :: ... | null | https://raw.githubusercontent.com/CloudI/CloudI/3e45031c7ee3e974ead2612ea7dd06c9edf973c9/src/external/cloudi_x_hackney/src/hackney_trace.erl | erlang | -*- erlang -*-
See the NOTICE for more information.
@doc start tracing
start tracing at level Level and send the result either to the file File,
Note: that it starts a tracer server.
% all ( printable ) inets trace events ( events which has
%% Severity within Limit) will be written to stdout using io:format.
... | This file is part of hackney released under the Apache 2 license .
-module(hackney_trace).
-export([enable/2, disable/0,
set_level/1,
report_event/4]).
-type trace_level() :: max | min | integer().
-type filename() :: string().
-type trace_type() :: io | filename() | port() | {fun(), any()}.
-export_type([tra... |
e7c00919b04f7f0d114de8e5a1b9809e72cfc41a11176a10b0de807b2053aeca | jxv/dino-rush | Camera.hs | module DinoRush.Effect.Camera where
import qualified SDL
import Control.Monad.IO.Class (MonadIO(..))
import Control.Monad.Reader (MonadReader, asks)
import Control.Monad.State (MonadState, modify, gets)
import Data.StateVar (($=))
import SDL.Vect
import DinoRush.Config
import DinoRush.State
import DinoRush.Engine.Cam... | null | https://raw.githubusercontent.com/jxv/dino-rush/f888bc05fe734ced2c49bec81f9c804b47c81069/library/DinoRush/Effect/Camera.hs | haskell | module DinoRush.Effect.Camera where
import qualified SDL
import Control.Monad.IO.Class (MonadIO(..))
import Control.Monad.Reader (MonadReader, asks)
import Control.Monad.State (MonadState, modify, gets)
import Data.StateVar (($=))
import SDL.Vect
import DinoRush.Config
import DinoRush.State
import DinoRush.Engine.Cam... | |
11ea211f15de4aba40c90ce58f3b4e901abfacc3f87627631826c6b57787f7b4 | mmottl/lacaml | real_io.ml | File : real_io.ml
Copyright ( C ) 2001-
email :
WWW :
email :
WWW : /
This library 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 ... | null | https://raw.githubusercontent.com/mmottl/lacaml/2e01c0747e740e54ab9a23ea59b29ea0d929b50f/src/real_io.ml | ocaml | File : real_io.ml
Copyright ( C ) 2001-
email :
WWW :
email :
WWW : /
This library 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 ... | |
60ad57d1f14aec51bbf5d4111b84387329243eca193911ccb6caf858de7d184a | DavidAlphaFox/RabbitMQ | lqueue.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/DavidAlphaFox/RabbitMQ/0a64e6f0464a9a4ce85c6baa52fb1c584689f49a/src/lqueue.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
| The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2011 - 2014 GoPivotal , Inc. All rights reserved .
-module... |
fa5acccbd0fef4a77f9d9d61640ea44cfac0e7c6e1b6dbe5bac53264d3f5f46c | GrammaticalFramework/gf-core | Translate.hs | {-# LANGUAGE TupleSections, TypeOperators #-}
module Translate
(mapp
,main
,bigTest
,evaluation
,evaluations
,main2
,mainTest
,mainT2
,testa
) where
import MonadSP
import Idents
import Test
import Structure
import qualified State as S
import ... | null | https://raw.githubusercontent.com/GrammaticalFramework/gf-core/9b4f2dd18b64b770aaebfa1885085e8e3447f119/treebanks/talbanken/Translate.hs | haskell | # LANGUAGE TupleSections, TypeOperators #
Test by runnig mainTest. Use testGr, otherwise very slow
newBigGr
----------------------------------------------------------------------------
Run functions
----------------------------------------------------------------------------
Standard main
---------------------------... | module Translate
(mapp
,main
,bigTest
,evaluation
,evaluations
,main2
,mainTest
,mainT2
,testa
) where
import MonadSP
import Idents
import Test
import Structure
import qualified State as S
import qualified Format as Form
import Control.Arrow... |
e4c6d4020e741d50d676cf899863123176599cdbfeaffd8e9fe4c3afecdb3cd4 | b0-system/b0 | b00_ocaml.mli | ---------------------------------------------------------------------------
Copyright ( c ) 2019 The b0 programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... | null | https://raw.githubusercontent.com/b0-system/b0/abd079159b3761e9327e11e74e6fa9c6b5325698/src/b00/kit/b00_ocaml.mli | ocaml | * Tools.
* [comp_env_vars] are environment variables that influence the
OCaml toolchain outputs.
* [ocamlc] is the [ocamlc] tool.
* [ocamlopt] is the [ocamlopt] tool.
* [ocamldep] is the [ocamldep] tool.
* [ocamlmklib] is the [ocamlmklib] tool.
* [ocamlobjinfo] is the [ocamlobjinfo] tool.
* [top_env_vars] ... | ---------------------------------------------------------------------------
Copyright ( c ) 2019 The b0 programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... |
0940ed0795da7b1cb3024c8d659e268c68acae9a5b7f11c65fdcd3c00cff358c | jesperes/aoc_erlang | benchmark.erl | -module(benchmark).
-export([benchmark/2]).
-include_lib("eunit/include/eunit.hrl").
benchmark(Msg, Fun) ->
% io:format(standard_error, "~s: start~n", [Msg]),
Reps = 10,
Total =
lists:foldl(fun(_, Sum) ->
{Time, _} = timer:tc(Fun),
Time + Sum
... | null | https://raw.githubusercontent.com/jesperes/aoc_erlang/527a63531313edd5675c2a1687b009d2fc1c3ea6/src/utils/benchmark.erl | erlang | io:format(standard_error, "~s: start~n", [Msg]), | -module(benchmark).
-export([benchmark/2]).
-include_lib("eunit/include/eunit.hrl").
benchmark(Msg, Fun) ->
Reps = 10,
Total =
lists:foldl(fun(_, Sum) ->
{Time, _} = timer:tc(Fun),
Time + Sum
end,
0,
... |
e993881537ddf653ff0bdf8aeb133c45fec4eb34c23880d48643ac6c36bf1d1b | thheller/shadow-cljsjs | ne.cljs | (ns cljsjs.moment.locale.ne
(:require ["moment/locale/ne"]))
| null | https://raw.githubusercontent.com/thheller/shadow-cljsjs/eaf350d29d45adb85c0753dff77e276e7925a744/src/main/cljsjs/moment/locale/ne.cljs | clojure | (ns cljsjs.moment.locale.ne
(:require ["moment/locale/ne"]))
| |
f250ab8d870f322cbe6d7db81ba22530f78c74d03ab04f901b667940ffe1d265 | fiddlerwoaroof/lisp-sandbox | promise-chaining.lisp | (ql:quickload :parenscript)
(defpackage :parenscript-chaining
(:use :cl :parenscript))
(in-package :parenscript-chaining)
(defclass promise ()
())
(defgeneric then (promise cb))
(defmacro+ps with-promise ((result-sym promise-form) &body body)
(let ((promise-sym (gensym)))
`(let* ((,promise-sym ,promise-fo... | null | https://raw.githubusercontent.com/fiddlerwoaroof/lisp-sandbox/38ff817c95af35db042faf760b477675264220d2/promise-chaining.lisp | lisp | (ql:quickload :parenscript)
(defpackage :parenscript-chaining
(:use :cl :parenscript))
(in-package :parenscript-chaining)
(defclass promise ()
())
(defgeneric then (promise cb))
(defmacro+ps with-promise ((result-sym promise-form) &body body)
(let ((promise-sym (gensym)))
`(let* ((,promise-sym ,promise-fo... | |
537f2a246a7cb28b61b3295ba4bde92287d58617ae5c8f11af5718ab9c610fe6 | wadehennessey/wcl | analyze.lisp | ( C ) Copyright 1990 - 2014 by . All rights reserved .
This is pass 1 of the compiler . Return an analyzed tree .
(defun analyze (form &optional (*dynamic-control-points* nil))
(let* ((*env* (make-lex-env :outermost-form form))
(*analysis-errors* 0)
(*node-id* -1)
(original-control-points *dynamic-contr... | null | https://raw.githubusercontent.com/wadehennessey/wcl/841316ffe06743d4c14b4ed70819bdb39158df6a/src/compiler/analyze.lisp | lisp | Keep analyzing until all block and tag xfers are correct!
When tail? is true we can *immediately* return form's value.
Move the tmp var increment into the analyzers?
specially handled by the linker -STILL???
RETURN-FROM needs this tmp mv holder
dummy control point
Need to push tree into env BEFORE analyzing the... | ( C ) Copyright 1990 - 2014 by . All rights reserved .
This is pass 1 of the compiler . Return an analyzed tree .
(defun analyze (form &optional (*dynamic-control-points* nil))
(let* ((*env* (make-lex-env :outermost-form form))
(*analysis-errors* 0)
(*node-id* -1)
(original-control-points *dynamic-contr... |
60e98030cd5538f36ccd78d0044d03e53ae880e17521f9605fb00fb05d98ed54 | smucclaw/dsl | TypesSpec.hs | {-# LANGUAGE OverloadedStrings #-}
module AnyAll.TypesSpec (spec) where
import Test.Hspec
import Data.Aeson (decode, encode)
import qualified Data.Map as Map
import AnyAll.Types
import Test.QuickCheck
import qualified Data.Text as T
import Test.QuickCheck.Instances.Text
type MarkingMap = Map.Map T.Text (Default Bool)... | null | https://raw.githubusercontent.com/smucclaw/dsl/7c1a1fde83cbf356331eab9d086cc7e9bb0a38ea/lib/haskell/anyall/test/AnyAll/TypesSpec.hs | haskell | # LANGUAGE OverloadedStrings # | module AnyAll.TypesSpec (spec) where
import Test.Hspec
import Data.Aeson (decode, encode)
import qualified Data.Map as Map
import AnyAll.Types
import Test.QuickCheck
import qualified Data.Text as T
import Test.QuickCheck.Instances.Text
type MarkingMap = Map.Map T.Text (Default Bool)
markingMap :: Either (Maybe Bool)... |
83514608315f2fe3bf6a7b8b70ff4737dd4c0389c989076dc72895b8eaf0fe43 | haskell/cabal | Graph.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE FlexibleContexts #
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
--------------------------... | null | https://raw.githubusercontent.com/haskell/cabal/0abbe37187f708e0a5daac8d388167f72ca0db7e/Cabal-syntax/src/Distribution/Compat/Graph.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE CPP #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
---------------------------------------------------------------------------
|
Module : Distribution.Compat.Graph
License : BSD3
Stabil... | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
Copyright : ( c ) 2016
Maintainer :
nodes ( identified by the ' IsNode ' type class ) are associated with a
operation , we first must build the " Data . Graph " representation , an
operation th... |
2d42d4c3e054f5d271925291dc9dd008ac9c9da2817d92aa4c12696ff69bfe35 | Tritlo/spectacular | TestConstraint.hs | module TestConstraint where
class TestConstraint a where
instance TestConstraint Bool | null | https://raw.githubusercontent.com/Tritlo/spectacular/00621f4f0f03e5d0afea3c730434a8842e473546/TestPlugin/TestConstraint.hs | haskell | module TestConstraint where
class TestConstraint a where
instance TestConstraint Bool | |
e7ee71c63373c246e5ca3eda318828fa62365da02d090c75b7618c21561b8d9e | ferd/ReVault | revault_dirmon_tracker.erl | %%% @doc
%%% Server in charge of listening to events about a given directory and
%%% tracking all the changes in memory
%%% @end
-module(revault_dirmon_tracker).
-behviour(gen_server).
-define(VIA_GPROC(Name), {via, gproc, {n, l, {?MODULE, Name}}}).
-export([start_link/4, stop/1, file/2, files/1]).
-export([update_id/2... | null | https://raw.githubusercontent.com/ferd/ReVault/37929d694a0246c12ad32f595544b9c654a832ec/apps/revault/src/revault_dirmon_tracker.erl | erlang | @doc
Server in charge of listening to events about a given directory and
tracking all the changes in memory
@end
optimization hint: replace the queue by an ordered_set ETS table?
known conflicts, track for syncs
Last known working file; track to know what hash to
pick when resolving the conflict, but do not use... | -module(revault_dirmon_tracker).
-behviour(gen_server).
-define(VIA_GPROC(Name), {via, gproc, {n, l, {?MODULE, Name}}}).
-export([start_link/4, stop/1, file/2, files/1]).
-export([update_id/2, conflict/3, conflict/4, update_file/4, delete_file/3]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2]).
-opaqu... |
f5c85762348998c021a9398bc12e09c5ccb7e2a930f1e2b76aa296680a829e36 | marcoheisig/Typo | function-lambda-lists.lisp | (in-package #:typo.fndb)
(defun function-lambda-list (function &optional (errorp t))
"Return the lambda list of FUNCTION, or an approximation thereof."
(let ((arglist (trivial-arguments:arglist function)))
(if (eq arglist :unknown)
(if errorp
(error "Cannot determine the lambda list of ~S."... | null | https://raw.githubusercontent.com/marcoheisig/Typo/d4d9e62d13d5260b235b10d4e421587942850d91/code/fndb/function-lambda-lists.lisp | lisp | (in-package #:typo.fndb)
(defun function-lambda-list (function &optional (errorp t))
"Return the lambda list of FUNCTION, or an approximation thereof."
(let ((arglist (trivial-arguments:arglist function)))
(if (eq arglist :unknown)
(if errorp
(error "Cannot determine the lambda list of ~S."... | |
12160f7a4dc4d34cf52fd7d1189294ba88126507154b5a37a75893253f7e00e5 | symbiont-io/detsys-testkit | Main.hs | module Main where
import Dumblog.Common.Constants
import Dumblog.Metrics.Main
------------------------------------------------------------------------
main :: IO ()
main = metricsMain dUMBLOG_PORT
| null | https://raw.githubusercontent.com/symbiont-io/detsys-testkit/b0ac098e40ffa2e344581ebe329c8f8805fce564/src/sut/dumblog/app/metrics/Main.hs | haskell | ---------------------------------------------------------------------- | module Main where
import Dumblog.Common.Constants
import Dumblog.Metrics.Main
main :: IO ()
main = metricsMain dUMBLOG_PORT
|
8fcbfad983b9dd29da892eb6b52b6e82b8204ab50e6fd751b58712f9a5a8d985 | henrik42/deeto | core_test.clj | (ns deeto.core-test
(:require [clojure.test :refer :all]
[deeto.core :refer :all]))
;; lein do clean, test
(def string-property ["String" {:property-name "String",
:property-type String,
:property-getter "getString",
... | null | https://raw.githubusercontent.com/henrik42/deeto/575e8ec8e309b575f16b7640fc92240279520b45/test/deeto/core_test.clj | clojure | lein do clean, test
Getters should return clones of internal state values. So mutating
the return value (e.g. an array) after calling the getter should
not change the dto.
if the getter returns a clone then mutating the returned array
should have no side-effect on int-dto
TBD: P's boolean equals(Object o) ... | (ns deeto.core-test
(:require [clojure.test :refer :all]
[deeto.core :refer :all]))
(def string-property ["String" {:property-name "String",
:property-type String,
:property-getter "getString",
:prope... |
f200f3286676e6bc32c72c39b19faa6f5414c065621de172b16dae6207b571a6 | xmonad/xmonad-contrib | WithAll.hs | -----------------------------------------------------------------------------
-- |
Module : XMonad . Actions . WithAll
-- Description : Perform a given action on all or certain groups of windows.
-- License : BSD3-style (see LICENSE)
-- Stability : unstable
-- Portability : unportable
--
-- Provides ... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/571d017b8259340971db1736eedc992a54e9022c/XMonad/Actions/WithAll.hs | haskell | ---------------------------------------------------------------------------
|
Description : Perform a given action on all or certain groups of windows.
License : BSD3-style (see LICENSE)
Stability : unstable
Portability : unportable
Provides functions for performing a given action on all or certain
gr... | Module : XMonad . Actions . WithAll
module XMonad.Actions.WithAll (
sinkAll, withAll,
withAll', killAll,
killOthers) where
import XMonad.Prelude hiding (foldr)
import XMonad
import XMonad.StackSet
> import XMonad . Actions . WithAll
sinkAll :: X ()
sinkAll = withAll' sink
withAll' :: (Windo... |
c4e8eab86c8657beff321b7b3a0cfcdc3c767f460ea867191e7c960b93a82463 | chaoxu/fancy-walks | 310.hs | {-# OPTIONS_GHC -O2 #-}
import Data.List
import Data.Array
import Data.Bits
mix :: [Int] -> Int
mix xs = head $ filter (\k -> not (checklist!k)) [0..]
where
n = length xs
checklist = accumArray (||) False (0, n) $ zip (filter (<=n) xs) (repeat True)
generate the ' SG ' function for [ 0 .. n ]
spragueGrun... | null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/projecteuler.net/310.hs | haskell | # OPTIONS_GHC -O2 #
target = triple + double + single |
import Data.List
import Data.Array
import Data.Bits
mix :: [Int] -> Int
mix xs = head $ filter (\k -> not (checklist!k)) [0..]
where
n = length xs
checklist = accumArray (||) False (0, n) $ zip (filter (<=n) xs) (repeat True)
generate the ' SG ' function for [ 0 .. n ]
spragueGrundy :: Int -> Int -> Int
... |
012399696e3a580cc959680f4c5a0051e8526d40a8aac49ae30a6fa0dd30d031 | tsloughter/kuberl | kuberl_v1beta1_controller_revision.erl | -module(kuberl_v1beta1_controller_revision).
-export([encode/1]).
-export_type([kuberl_v1beta1_controller_revision/0]).
-type kuberl_v1beta1_controller_revision() ::
#{ 'apiVersion' => binary(),
'data' => maps:map(),
'kind' => binary(),
'metadata' => kuberl_v1_object_meta:kuberl_v1_object_me... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1beta1_controller_revision.erl | erlang | -module(kuberl_v1beta1_controller_revision).
-export([encode/1]).
-export_type([kuberl_v1beta1_controller_revision/0]).
-type kuberl_v1beta1_controller_revision() ::
#{ 'apiVersion' => binary(),
'data' => maps:map(),
'kind' => binary(),
'metadata' => kuberl_v1_object_meta:kuberl_v1_object_me... | |
fbb80cb6b4a74bedaf60c61a594d199ebe73091799651f417bb66dc8f03729a8 | imrehg/ypsilon | gl.scm | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gl)
(export GL_FALSE
GL_TRUE
GL_BYTE
GL_UNSIGNED_BYTE
GL_SHORT
GL_UNSIGNED_SHORT
... | null | https://raw.githubusercontent.com/imrehg/ypsilon/e57a06ef5c66c1a88905b2be2fa791fa29848514/sitelib/ypsilon/gl.scm | scheme | Data types
Primitives
Vertex Arrays
Points
Lines
Display Lists
Depth buffer
Lighting
User clipping planes
Accumulation buffer
Alpha testing
Blending
Feedback
Fog
Stencil
GL_FRONT 0x0404
Implementation limits
Gets
Evaluators
Hints
Scissor box
Texture mapping
Utility
Errors
OpenGL... | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gl)
(export GL_FALSE
GL_TRUE
GL_BYTE
GL_UNSIGNED_BYTE
GL_SHORT
GL_UNSIGNED_SHORT
... |
728a869e29e56b9ebf93ca269cd0d235dd120c41e28c5878552a994040e26288 | melange-re/melange | hash_collision_test.ml |
let suites : Mt.pair_suites ref = ref []
let test_id = ref 0
let eq loc x y = Mt.eq_suites ~test_id ~suites loc x y
type collision = [`Eric_Cooper | `azdwbie];;
let f0 x =
match x with
| `Eric_Cooper -> 0
| `azdwbie -> 1
let f1 x =
match x with
| `Eric_Cooper x -> x + 1
| `azdwbie x -> ... | null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/test/hash_collision_test.ml | ocaml |
let suites : Mt.pair_suites ref = ref []
let test_id = ref 0
let eq loc x y = Mt.eq_suites ~test_id ~suites loc x y
type collision = [`Eric_Cooper | `azdwbie];;
let f0 x =
match x with
| `Eric_Cooper -> 0
| `azdwbie -> 1
let f1 x =
match x with
| `Eric_Cooper x -> x + 1
| `azdwbie x -> ... | |
1539e9315c3915f47e09feed77ecbe0479e3ecefb47a00559cb7ce75246b2145 | processone/tsung | ts_tcp6.erl | %%%
Copyright 2012 ©
%%%
Author : < >
Created : 7 sep 2012 by < >
%%%
%%% 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 ; either version 2 of the License , or
%%% (at your op... | null | https://raw.githubusercontent.com/processone/tsung/e9babe2acfb4298e3b51bd56886561b052979884/src/tsung/ts_tcp6.erl | erlang |
This program is free software; you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Genera... | Copyright 2012 ©
Author : < >
Created : 7 sep 2012 by < >
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
You should have received a copy of the GNU General Public License
Foundation , Inc. , 59 Temple ... |
7cb859c36b362bfad4fa9822278040df9f7979a73a6066f3a3765d70d8d9f7c9 | CloudI/CloudI | trap_exit_protocol.erl | -module(trap_exit_protocol).
-behaviour(ranch1_protocol).
-export([start_link/4]).
-export([init/4]).
start_link(Ref, Socket, Transport, Opts) ->
Pid = spawn_link(?MODULE, init, [Ref, Socket, Transport, Opts]),
{ok, Pid}.
init(Ref, Socket, Transport, _Opts = []) ->
process_flag(trap_exit, true),
ok = ranch1:acce... | null | https://raw.githubusercontent.com/CloudI/CloudI/3e45031c7ee3e974ead2612ea7dd06c9edf973c9/src/external/cloudi_x_ranch1/test/trap_exit_protocol.erl | erlang | -module(trap_exit_protocol).
-behaviour(ranch1_protocol).
-export([start_link/4]).
-export([init/4]).
start_link(Ref, Socket, Transport, Opts) ->
Pid = spawn_link(?MODULE, init, [Ref, Socket, Transport, Opts]),
{ok, Pid}.
init(Ref, Socket, Transport, _Opts = []) ->
process_flag(trap_exit, true),
ok = ranch1:acce... | |
0fa81a9e3d0c0c27ed0e6f27493a943469d40d6f5c2087f23ee691a4a4d05ef0 | marcoheisig/simplified-types | simplify-type.lisp | (in-package #:simplified-types)
(trivia:defpattern floating-point-type-specifier (type)
`(or ',type
(list ',type)
(list ',type
(or (type ,type) (list (type ,type)) '*))
(list ',type
(or (type ,type) (list (type ,type)) '*)
(or (type ,type) (list (type ,type... | null | https://raw.githubusercontent.com/marcoheisig/simplified-types/8fd0727a70a9de76289ac62c1567b8d278e7434e/code/simplify-type.lisp | lisp | Unsigned integer types.
Signed integer types.
Interval integer types.
Cons types.
Floating point types.
Complex types.
Logical connectives.
Member types.
Skip already simplified type specifiers.
Attempt to detect malformed type specifiers.
Handle function types. These are too hairy for pattern matching.
At... | (in-package #:simplified-types)
(trivia:defpattern floating-point-type-specifier (type)
`(or ',type
(list ',type)
(list ',type
(or (type ,type) (list (type ,type)) '*))
(list ',type
(or (type ,type) (list (type ,type)) '*)
(or (type ,type) (list (type ,type... |
896b9775661dcec11d7fa2d126e2c42a4629d14a363b9058e9c9b20b1855308c | alekcz/pcp | utility_test.clj | (ns pcp.utility-test
(:require [clojure.test :refer [deftest is testing use-fixtures]]
[pcp.core :as core]
[pcp.resp :as resp]
[pcp.utility :as utility]
[clojure.string :as str]
[clojure.java.io :as io]
[cheshire.core :as json]
[clj-h... | null | https://raw.githubusercontent.com/alekcz/pcp/deae9f52908de876564da5e84f452ca37917ea6b/test/pcp/utility_test.clj | clojure | (ns pcp.utility-test
(:require [clojure.test :refer [deftest is testing use-fixtures]]
[pcp.core :as core]
[pcp.resp :as resp]
[pcp.utility :as utility]
[clojure.string :as str]
[clojure.java.io :as io]
[cheshire.core :as json]
[clj-h... | |
e50f912123d024189892b2839c5e4a5ae4e83d3ed2353e6666579e1b5e95997d | MinaProtocol/mina | transaction_snark.ml | open Utils
module Types = struct
module type S = sig
module V2 : S0
end
end
module type Concrete = sig
module Proof : sig
module V2 : sig
type t = Pickles.Proof.Proofs_verified_2.V2.t
end
end
module V2 : sig
type t =
{ statement : Mina_state.Snarked_ledger_state.With_sok.V2.t
... | null | https://raw.githubusercontent.com/MinaProtocol/mina/57e2ea1b87fe1a24517e1c62f51cc59fe9bc87cd/src/lib/mina_wire_types/transaction_snark.ml | ocaml | open Utils
module Types = struct
module type S = sig
module V2 : S0
end
end
module type Concrete = sig
module Proof : sig
module V2 : sig
type t = Pickles.Proof.Proofs_verified_2.V2.t
end
end
module V2 : sig
type t =
{ statement : Mina_state.Snarked_ledger_state.With_sok.V2.t
... | |
eda1be87295216d1294e123a8ef06913807de9da7dcba6486e3ae522632430bf | gedge-platform/gedge-platform | amqp10_client_session.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(amqp10_client_session).
-behaviour(gen_st... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/amqp10_client/src/amqp10_client_session.erl | erlang |
Public API.
Private API.
gen_statem callbacks
gen_statem state callbacks.
-type from() :: {pid(), term()}.
maps link name to outgoing link handle
maps incoming handle to outgoing
the unsettled map needs to go in the session state as a disposition
can reference transfers for many different links
TODO: refin... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
-module(amqp10_client_session).
-behaviour(gen_statem).... |
3bf76ddf8f0ee878df5ff886adba1ae8642119eff17e01ca3735b819c9944d17 | bobzhang/fan | syntaxf.ml | let a_ident = Gramf.mk "a_ident"
let aident = Gramf.mk "aident"
let amp_ctyp = Gramf.mk "amp_ctyp"
let and_ctyp = Gramf.mk "and_ctyp"
let case = Gramf.mk "case"
let case0 = Gramf.mk "case0"
let bind = Gramf.mk "bind"
let class_declaration = Gramf.mk "class_declaration"
let class_description = Gramf.mk "class_descriptio... | null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/cold/syntaxf.ml | ocaml | let a_ident = Gramf.mk "a_ident"
let aident = Gramf.mk "aident"
let amp_ctyp = Gramf.mk "amp_ctyp"
let and_ctyp = Gramf.mk "and_ctyp"
let case = Gramf.mk "case"
let case0 = Gramf.mk "case0"
let bind = Gramf.mk "bind"
let class_declaration = Gramf.mk "class_declaration"
let class_description = Gramf.mk "class_descriptio... | |
6b2f78d50cc6f21417c382a8048d0196431ef2e1b3a08cf838a59c475a3feeaf | tarides/dune-release | config.mli |
* Copyright ( c ) 2018 < >
*
* 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 AU... | null | https://raw.githubusercontent.com/tarides/dune-release/6bfed0f299b82c0931c78d4e216fd0efedff0673/lib/config.mli | ocaml | * Type for configuration values passed through the CLI.
* Returns the token value that should be used for github API requests. If a
[token] was provided via the CLI, it is returned. Otherwise the token file
in the config dir is looked up. If it exists, its content is returned, if it
does not, the user is p... |
* Copyright ( c ) 2018 < >
*
* 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 AU... |
b71eb6d7d3b23dce3ac6deb45dfdce406c21c73c56f1074b518ef6b4fe712d06 | senapk/funcional_arcade | solver.hs | inits [ 1,3,5 ] = = [ [ ] , [ 1],[1,3],[1,3,5 ] ]
inits :: [a] -> [[a]]
inits [] = [[]]
inits xs = inits sem_rabinho ++ [xs]
where sem_rabinho = reverse . tail . reverse $ xs | null | https://raw.githubusercontent.com/senapk/funcional_arcade/89625b4559b3e590d88dd70a27b6cbdc07cc2988/base/070/solver.hs | haskell | inits [ 1,3,5 ] = = [ [ ] , [ 1],[1,3],[1,3,5 ] ]
inits :: [a] -> [[a]]
inits [] = [[]]
inits xs = inits sem_rabinho ++ [xs]
where sem_rabinho = reverse . tail . reverse $ xs | |
f20ccff616f24a8322c581737a58663c1ab3740d00a62da8a6a6be11cb3af2f3 | mathematical-systems/clml | dlacpy.lisp | ;;; Compiled by f2cl version:
( " $ I d : f2cl1.l , v 1.209 2008/09/11 14:59:55 rtoy Exp $ "
" $ I d : f2cl2.l , v 1.37 2008/02/22 22:19:33 "
" $ I d : f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Rel $ "
" $ I d : f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Rel $ "
" $ I d : f2cl5.l , v 1.197 2008/09/11 15:0... | null | https://raw.githubusercontent.com/mathematical-systems/clml/918e41e67ee2a8102c55a84b4e6e85bbdde933f5/lapack/dlacpy.lisp | lisp | Compiled by f2cl version:
Options: ((:prune-labels nil) (:auto-save t)
(:relaxed-array-decls t) (:coerce-assigns :as-needed)
(:array-type ':array) (:array-slicing t)
(:declare-common nil) (:float-format double-float)) | ( " $ I d : f2cl1.l , v 1.209 2008/09/11 14:59:55 rtoy Exp $ "
" $ I d : f2cl2.l , v 1.37 2008/02/22 22:19:33 "
" $ I d : f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Rel $ "
" $ I d : f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Rel $ "
" $ I d : f2cl5.l , v 1.197 2008/09/11 15:03:25 rtoy Exp $ "
" $ I d :... |
64d94ba7549a4a4c7f806c45dca446f8a5baf461a37cc3da3b67bb93ebbd8543 | alanz/ghc-exactprint | TypedSplice.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE NamedWildCards #
# LANGUAGE PartialTypeSignatures #
module TypedSplice where
import Language.Haskell.TH
metaExp :: Q (TExp (Bool -> Bool))
metaExp = [|| not :: _ -> _b ||]
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/TypedSplice.hs | haskell | # LANGUAGE TemplateHaskell #
# LANGUAGE NamedWildCards #
# LANGUAGE PartialTypeSignatures #
module TypedSplice where
import Language.Haskell.TH
metaExp :: Q (TExp (Bool -> Bool))
metaExp = [|| not :: _ -> _b ||]
| |
9c96c1dc7256a76ba3b98660f483090a3ce58df43690c4bcbd64973a418824a6 | bsansouci/reasonglexampleproject | viewer.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bsansouci/reasonglexampleproject/4ecef2cdad3a1a157318d1d64dba7def92d8a924/vendor/camlimages/examples/liv/viewer.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1999 - 2004 ,
Institut National de Recherche en Informatique et en Automatique .
$ I d : viewer.ml , v 1.5 2004/09/23 07:20:20 weis Exp $
open Gdk
open Gtk
let sync () = while Glib.Main... |
185c6b3ad4b2fa539408efe93c837fc87e0e673c2578637725496df86576a457 | NorfairKing/dekking | Record.hs | module Record where
main :: IO ()
main = do
print $ addOne $ Example {unExample = 1}
newtype Example = Example {unExample :: Int}
deriving (Show)
addOne :: Example -> Example
addOne e = e {unExample = unExample e + 1}
| null | https://raw.githubusercontent.com/NorfairKing/dekking/0b24602f9762edc203f65168fc8c09e7291b4a4b/e2e-test/syntax/src/Record.hs | haskell | module Record where
main :: IO ()
main = do
print $ addOne $ Example {unExample = 1}
newtype Example = Example {unExample :: Int}
deriving (Show)
addOne :: Example -> Example
addOne e = e {unExample = unExample e + 1}
| |
3eee00d9f3282c8e0d5288e71f746296d9c889018e7073974f49d6bf606f6e38 | toolslive/camltc | logging.ml |
Copyright ( 2010 - 2014 ) INCUBAID BVBA
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
distribut... | null | https://raw.githubusercontent.com/toolslive/camltc/0f23bfb5b98e481f69c1ed548b3fc48376f8967c/src/logging.ml | ocaml |
Copyright ( 2010 - 2014 ) INCUBAID BVBA
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
distribut... | |
234f83c902afc91078a69a6bf8838e7f2e66eddd825413ec5b318103544f4590 | batebobo/fp1819 | 1-get-kth.rkt | #lang racket
(require rackunit)
(require rackunit/text-ui)
(define my-list '(1 2 3 (4 5) (6 (7 8))))
Искаме с подходящи извиквания на car вземем .
| null | https://raw.githubusercontent.com/batebobo/fp1819/2061b7e62a1a9ade3a5fff9753f9fe0da5684275/scheme/4/1-get-kth.rkt | racket | #lang racket
(require rackunit)
(require rackunit/text-ui)
(define my-list '(1 2 3 (4 5) (6 (7 8))))
Искаме с подходящи извиквания на car вземем .
| |
6dc0651c93c5fdc2c72fd604d92bc2d5e4e0041ce7ff9c50ff6b061fa98a32ed | gar1t/psycho | psycho_opt.erl | %% ===================================================================
@author < >
2011 - 2012
%%
%% @doc e2 option validation utility.
%%
%% For example in how this facility can be used to validate options
%% lists, see [
%% test/e2_opt_tests.erl].
%% @end
%% =================================================... | null | https://raw.githubusercontent.com/gar1t/psycho/6335b9c27559f417e613372776edbea760720559/src/psycho_opt.erl | erlang | ===================================================================
@doc e2 option validation utility.
For example in how this facility can be used to validate options
lists, see [
test/e2_opt_tests.erl].
@end
===================================================================
=================================... | @author < >
2011 - 2012
-module(psycho_opt).
-export([validate/2, validate/3, value/2, value/3]).
-define(NO_DEFAULT, '$e2_opt_nodefault').
-record(schema, {implicit, constraints}).
-record(constraint,
{values,
type,
min,
max,
pattern,
validate,
... |
e80414962c58892f36d61ca8de637a7558df378a3caf60742a4181a55e8e532b | ktakashi/sagittarius-scheme | make-test-vectors.scm | (import (rnrs)
(text json)
(text json pointer)
(util file)
(util bytevector)
(asn.1) ;; old...
(srfi :13)
(pp)
(getopt))
(define ((file-prefix? prefix*) path)
(let-values (((dir file ext) (decompose-path path)))
(exists (lambda (prefix) (string-prefix? prefix file)) prefix*)))
(define signature-vector?
... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/1ef9a2177a6e899381a441a8bbfdc09f0da38c1b/tools/scripts/make-test-vectors.scm | scheme | old... | (import (rnrs)
(text json)
(text json pointer)
(util file)
(util bytevector)
(srfi :13)
(pp)
(getopt))
(define ((file-prefix? prefix*) path)
(let-values (((dir file ext) (decompose-path path)))
(exists (lambda (prefix) (string-prefix? prefix file)) prefix*)))
(define signature-vector?
(file-prefix? '("d... |
ea065956229e356f7cf54b6e791a5d442288b203976f0c4451b900d64499cfae | digital-asset/ghc | Example.hs | # LANGUAGE DamlSyntax #
# LANGUAGE TypeApplications #
# LANGUAGE DataKinds #
# LANGUAGE RecordWildCards #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
module Example where
This file contains an example of a DAML template which can be c... | null | https://raw.githubusercontent.com/digital-asset/ghc/17268c72ca9983883426e996287a284802a30539/Example.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DamlSyntax #
# LANGUAGE TypeApplications #
# LANGUAGE DataKinds #
# LANGUAGE RecordWildCards #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
module Example where
This file contains an example of a DAML template which can be compiled , desugared , and type - ch... |
f384d7c871f8cac43bb5830470f4c26628821a85175c3d17cee1a7bf79e03075 | jordanthayer/ocaml-search | wrutils.ml | $ I d : utils.ml , v 1.2 2003/09/27 01:11:58 ruml Exp ruml $
misc utility code
misc utility code
*)
(***** quick debugging utilities ******)
let write_this () = prerr_string "WRITE_THIS\n"
let not_impl () = failwith "not yet implemented"
let pr = Printf.printf
let pe = Printf.eprintf
let pf = Pri... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/wrutils/wrutils.ml | ocaml | **** quick debugging utilities *****
* flushes a string to stdout
* give format string and args, raises failure with formatted string
***** useful misc functions ******
* given format string and args, returns string
**** flow of control *****
* evaluates [f] on [f_arg], ensuring that [clean_f] is called on
[clea... | $ I d : utils.ml , v 1.2 2003/09/27 01:11:58 ruml Exp ruml $
misc utility code
misc utility code
*)
let write_this () = prerr_string "WRITE_THIS\n"
let not_impl () = failwith "not yet implemented"
let pr = Printf.printf
let pe = Printf.eprintf
let pf = Printf.fprintf
let newline ch = output_char ... |
353195fa8aa629786c49945cbc25b78cfa3987ae6d68d65fcf4a9e3ad4a55346 | mokus0/junkbox | Test2.hs | {-# LANGUAGE Safe #-}
-- should compile when base, prim-uniq, dependent-sum and dependent-map are trusted.
The latter 2 would n't even require trust were it not for their Typeable instances
-- which cannot be derived.
module Safe.Test2 where
import Data.Dependent.Map
import Data.Unique.Tag
import Math.ContinuedFract... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Safe/Test2.hs | haskell | # LANGUAGE Safe #
should compile when base, prim-uniq, dependent-sum and dependent-map are trusted.
which cannot be derived. | The latter 2 would n't even require trust were it not for their Typeable instances
module Safe.Test2 where
import Data.Dependent.Map
import Data.Unique.Tag
import Math.ContinuedFraction
phi = (1 + sqrt 5) / 2
phiCF = cf 1 (repeat 1)
main = do
x <- newTag
let m = singleton x "hello world"
print (m ! x)
... |
c4124bc14fa8d85846c53f4a56d51b0a33994a2abcd7402ba425f5a48412c93b | nuprl/gradual-typing-performance | lnm-plot.rkt | #lang typed/racket/base
Create L - N / M plots for .rktd files
;;
;; At a high level:
;; Input:
- Raw experimental data ( .rktd )
;; (Optionally a list)
;; Output:
;; - Pict showing an L-N/M plot for the data
;; (Or, a list of such plots)
(provide
lnm-plot
;; Create an L-NM plot based on the given paramet... | null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/paper/popl-2016/talk/scripts/lnm-plot.rkt | racket |
At a high level:
Input:
(Optionally a list)
Output:
- Pict showing an L-N/M plot for the data
(Or, a list of such plots)
Create an L-NM plot based on the given parameters (see function for params)
Plots the number of acceptable paths.
Acceptable paths have no overhead greater than the cutoff along any poi... | #lang typed/racket/base
Create L - N / M plots for .rktd files
- Raw experimental data ( .rktd )
(provide
lnm-plot
Builds one plot for each given value of L.
path-plot
death-plot
)
(require
plot/typed/pict
(only-in racket/math exact-floor)
(only-in plot/utils linear-seq)
(only-in racket/math e... |
28b3bfcdfe1c261b8ed84a91a4926cfba01ae4bd7d6669b449028b479b854e92 | zwizwa/rai | 20191117.rkt | #lang s-exp rai/stream
(require rai/stream-lib
rai/synth-lib)
(provide (all-defined-out))
;; See doodle.rkt
;; This is messy exploratory stuff.
;; When cloning, add it to
(define-values
(main main-defaults)
(lambda/params (samplerate)
(let* ((f '0.0017)
3500 - 6100
3500 - 6100
.01 - .0003 ... | null | https://raw.githubusercontent.com/zwizwa/rai/6bcacb7da4172971816027fd88a0209adbd60e30/test/20191117.rkt | racket | See doodle.rkt
This is messy exploratory stuff.
When cloning, add it to
.00052 - .01
(megasaw6) | #lang s-exp rai/stream
(require rai/stream-lib
rai/synth-lib)
(provide (all-defined-out))
(define-values
(main main-defaults)
(lambda/params (samplerate)
(let* ((f '0.0017)
3500 - 6100
3500 - 6100
.01 - .0003
(s (* .1 (* e1 (saw-d3 f))))
(l (svf-lp s (* e2 '1... |
a017b2acc66c38d4819dcf11d32eff05c3a20a0668dfdf9bd6320461ad691715 | fukamachi/clozure-cl | arm-bignum.lisp | -*- Mode : Lisp ; Package : CCL -*-
;;;
Copyright ( C ) 2010 Clozure Associates
This file is part of Clozure CL .
;;;
Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
License , known as the LLGPL and distributed with Clozure CL as the
;;; file "LICENSE". The LLGPL consists of a... | null | https://raw.githubusercontent.com/fukamachi/clozure-cl/4b0c69452386ae57b08984ed815d9b50b4bcc8a2/level-0/ARM/arm-bignum.lisp | lisp | Package : CCL -*-
file "LICENSE". The LLGPL consists of a preamble and the LGPL,
conflict, the preamble takes precedence.
Clozure CL is referenced in the preamble as the "LIBRARY."
The LLGPL is also available online at
%BIGNUM-REF needs to access bignums as obviously as possible, and it needs
... | Copyright ( C ) 2010 Clozure Associates
This file is part of Clozure CL .
Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
License , known as the LLGPL and distributed with Clozure CL as the
which is distributed with Clozure CL as the file " LGPL " . Where these
(in-packag... |
550894672dcc42ba23593a1e90867f4e6ce5b2fa5e1484d2676dba1198c4e254 | cram2/cram | matrix-mean.lisp | Regression test MATRIX - MEAN for GSLL , automatically generated
;;
Copyright 2009 , 2011
Distributed under the terms of the GNU General Public License
;;
;; 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 So... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_3rdparty/gsll/src/tests/matrix-mean.lisp | lisp |
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Publi... | Regression test MATRIX - MEAN for GSLL , automatically generated
Copyright 2009 , 2011
Distributed under the terms of the GNU General Public License
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have rec... |
e8c3a224248df299ebfe7459caf9fd02f80aefafed8f084ff74d218ee901f971 | jbreindel/battlecraft | bc_entity.erl |
-module(bc_entity).
%% API exports
-export([init/9,
init/10,
uuid_str/1,
uuid/1,
player_id/1,
set_player_id/2,
player_num/1,
set_player_num/2,
team/1,
set_team/2,
entity_type/1,
health/1,
set_health/2,
max_health/1,
set_max_health/2,
ai_fsm/1,
set_ai_fsm/2,
orie... | null | https://raw.githubusercontent.com/jbreindel/battlecraft/622131a1ad8c46f19cf9ffd6bf32ba4a74ef4137/apps/bc_entity/src/bc_entity.erl | erlang | API exports
@doc base entity type for saving and transfering entities.
type exports
====================================================================
API functions
==================================================================== |
-module(bc_entity).
-export([init/9,
init/10,
uuid_str/1,
uuid/1,
player_id/1,
set_player_id/2,
player_num/1,
set_player_num/2,
team/1,
set_team/2,
entity_type/1,
health/1,
set_health/2,
max_health/1,
set_max_health/2,
ai_fsm/1,
set_ai_fsm/2,
orientation/1,
s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.