_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 |
|---|---|---|---|---|---|---|---|---|
214334b51db09be0e6ee90457618f63ec44b2dd2d6d3e065a4ad223f006a3cb7 | skypher/blackthorn | atdoc.lisp | Blackthorn -- Lisp Game Engine
;;;;
Copyright ( c ) 2007 - 2011 , < >
;;;;
;;;; Permission is hereby granted, free of charge, to any person
;;;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;;;; restriction, including without limita... | null | https://raw.githubusercontent.com/skypher/blackthorn/914b38a95f1d192219f197e4b4a77b1632daa94b/atdoc.lisp | lisp |
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
furnished to do so, subject to the following conditions:... | Blackthorn -- Lisp Game Engine
Copyright ( c ) 2007 - 2011 , < >
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRA... |
eb705defd85711db78c96635fc8b88283e7e491917f8a389cb35a25b35ef9678 | ktahar/ocaml-lp | test_glpk_js.ml | module To_test = struct
let g = Lp_glpk_js.require_glpk "glpk.js"
let to_list prob xs =
List.map
(fun v -> Lp.PMap.find (Lp.Poly.of_var v) xs)
(Lp.Problem.uniq_vars prob)
let solve_lp0 () =
let p = Lp.read "lp0.lp" in
match Lp_glpk_js.solve ~term_output:false g p with
| Ok (obj, xs) ... | null | https://raw.githubusercontent.com/ktahar/ocaml-lp/344fc7b99a2d938438ec9abed0d9cd4b3cddc66a/test/lp-glpk-js/test_glpk_js.ml | ocaml | module To_test = struct
let g = Lp_glpk_js.require_glpk "glpk.js"
let to_list prob xs =
List.map
(fun v -> Lp.PMap.find (Lp.Poly.of_var v) xs)
(Lp.Problem.uniq_vars prob)
let solve_lp0 () =
let p = Lp.read "lp0.lp" in
match Lp_glpk_js.solve ~term_output:false g p with
| Ok (obj, xs) ... | |
e0c89a48275b8601f17e953c7f90285cae5b2901851d498288c9ceaca4cf7c75 | gga/json-path | walker.clj | (ns json-path.walker
[:require [json-path.match :as m]])
(declare walk eval-expr)
' and ' and ' or ' are macros in Clojure , so we wrap them in functions here so they
;; can be passed to apply and tested for equality
(defn and* [a b]
(and a b))
(defn or* [a b]
(or a b))
(defn eval-bool-expr [comp-fn context... | null | https://raw.githubusercontent.com/gga/json-path/3de33432b5860ba103f586ff1c61f11cb994c54b/src/json_path/walker.clj | clojure | can be passed to apply and tested for equality
allow less-than, greater-than comparisons if both args are Numbers or Strings
always allow equality comparisons as well as 'and' and 'or'
NOTE: see comment above, these macros are wrapped as functions | (ns json-path.walker
[:require [json-path.match :as m]])
(declare walk eval-expr)
' and ' and ' or ' are macros in Clojure , so we wrap them in functions here so they
(defn and* [a b]
(and a b))
(defn or* [a b]
(or a b))
(defn eval-bool-expr [comp-fn context operands]
(boolean
(apply
(fn [a b]
... |
efc545e6a030dc90bf9c1bc7cfe6e787fb189b12d47d18ea7aef6b3cbd07d50d | google/proto-lens | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Proto.Person as P
import Proto.Person_Fields as P
import Data.ProtoLens (defMessage, showMessage)
import Lens.Micro
person :: P.Person
person =
defMessage
& P.name .~ "Fintan"
& P.age .~ 24
& P.addresses .~ [address]
where
... | null | https://raw.githubusercontent.com/google/proto-lens/081815877430afc1db669ca5e4edde1558b5fd9d/proto-lens-tutorial/person/src/Main.hs | haskell | # LANGUAGE OverloadedStrings # |
module Main where
import Proto.Person as P
import Proto.Person_Fields as P
import Data.ProtoLens (defMessage, showMessage)
import Lens.Micro
person :: P.Person
person =
defMessage
& P.name .~ "Fintan"
& P.age .~ 24
& P.addresses .~ [address]
where
address :: P.Address
address... |
6794197c3d262ed840a0f247c1c4cf22db4082a1e79f6f3442781df4502a0424 | Clojure2D/clojure2d-examples | randomwalknoise.clj | (ns examples.NOC.introduction.randomwalknoise
(:require [clojure2d.core :refer :all]
[fastmath.core :as m]
[fastmath.random :as r]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(defn calc-noise
"Return position based on noise values."
[tx ty w h]
[(m/norm (r... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/9de82f5ac0737b7e78e07a17cf03ac577d973817/src/NOC/introduction/randomwalknoise.clj | clojure | (ns examples.NOC.introduction.randomwalknoise
(:require [clojure2d.core :refer :all]
[fastmath.core :as m]
[fastmath.random :as r]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(defn calc-noise
"Return position based on noise values."
[tx ty w h]
[(m/norm (r... | |
b7ac7176dab6e63ba0181965062e28c0baa045ab77797680cb913313b9d40b92 | 05st/capri | Codegen.hs | {-# Language TupleSections #-}
{-# Language FlexibleContexts #-}
{-# Language LambdaCase #-}
{-# Language RecursiveDo #-}
{-# Language OverloadedStrings #-}
# Language MultiParamTypeClasses #
module Codegen where
import qualified LLVM.AST.IntegerPredicate as IP
import qualified LLVM.AST.FloatingPointPredicate as FP
... | null | https://raw.githubusercontent.com/05st/capri/aed6f6cce3302992a7f6519fa830faa825ba65c5/src/Codegen.hs | haskell | # Language TupleSections #
# Language FlexibleContexts #
# Language LambdaCase #
# Language RecursiveDo #
# Language OverloadedStrings #
Using some recursive-do magic to register the function operands before the functions are defined
so functions can be called before they are 'defined'.
there probably exists a bette... | # Language MultiParamTypeClasses #
module Codegen where
import qualified LLVM.AST.IntegerPredicate as IP
import qualified LLVM.AST.FloatingPointPredicate as FP
import LLVM.AST (Operand)
import qualified LLVM.AST as AST
import qualified LLVM.AST.Type as AST
import qualified LLVM.AST.Constant as Const
import qualified... |
17e7a624db88c5269a106c20585182db6e50b6cfb9b4c31805318ec732ff8b10 | ppelleti/McLabel | McOptions.hs | {-# LANGUAGE MultiWayIf #-}
module McOptions
( homepage
, parseOptionsIO
) where
import Control.Monad ( when )
import Data.Version ( showVersion )
import System.Environment ( getArgs )
import System.Exit ( exitSuccess, exitFailure )
import System.Info ( compilerVersion, compilerName )
import System.IO ( stderr,... | null | https://raw.githubusercontent.com/ppelleti/McLabel/4673b86705f701d29c8d730c59dc5654fcc6c441/src/McOptions.hs | haskell | # LANGUAGE MultiWayIf # |
module McOptions
( homepage
, parseOptionsIO
) where
import Control.Monad ( when )
import Data.Version ( showVersion )
import System.Environment ( getArgs )
import System.Exit ( exitSuccess, exitFailure )
import System.Info ( compilerVersion, compilerName )
import System.IO ( stderr, hPutStrLn )
import Paths_M... |
cfbf968dcbafe88215ac90376428bbfce86c680d0d8a562cb87d9c118a700a3a | backtracking/functory | main_poly.ml | (**************************************************************************)
(* *)
(* Functory: a distributed computing library for OCaml *)
Copyright ( C ) 2010- and
(* ... | null | https://raw.githubusercontent.com/backtracking/functory/75368305a853a90ebea9e306d82e4ef32649d1ce/tests/mandelbrot/main_poly.ml | ocaml | ************************************************************************
Functory: a distributed computing library for OCaml
This software is free soft... | Copyright ( C ) 2010- and
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
open Functory.Network
let () = declare_workers ~n:8 "belzebuth"
let () = Functory.Control.set_debug true
open Poly
let is_worker = A... |
91c5eaa95f04d426875c8c08dd521da2ede8f3892d8f52091886f7232dcf82fd | cjdev/cloud-seeder | AWS.hs | # OPTIONS_GHC -fno - warn - overlapping - patterns #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
module Network.CloudSeeder.Monads.AWS
( MonadCloud(..)
, computeChangeset'
, deleteStack'
, describeChangeSet'
, describeStack'
, runChangeSet'
, encrypt'
, upload'
, generateSecret'
... | null | https://raw.githubusercontent.com/cjdev/cloud-seeder/242a3826a0cef58e1c390b51177e025781aecc66/library/Network/CloudSeeder/Monads/AWS.hs | haskell | | A class of monads that can interact with cloud deployments.
change set name must begin with a letter
because we're filtering out characters, we need to pad the random data to
ensure we end up with a secret of the right size. | # OPTIONS_GHC -fno - warn - overlapping - patterns #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
module Network.CloudSeeder.Monads.AWS
( MonadCloud(..)
, computeChangeset'
, deleteStack'
, describeChangeSet'
, describeStack'
, runChangeSet'
, encrypt'
, upload'
, generateSecret'
... |
1f1dc179c01d0781bae332e6e73c5397396efaa58be7a9b4e88eeccd59afb4ef | directrix1/DuplicateBridgeTeamSteele | Trankings.lisp | The first four lines of this file were added by .
They tell that this is a Dracula Modular ACL2 program .
Leave these lines unchanged so that DrScheme can properly load this file .
#reader(planet "reader.ss" ("cce" "dracula.plt") "modular" "lang")
(require "../modules/Mbasiclex.lisp")
(require "../modules/Mran... | null | https://raw.githubusercontent.com/directrix1/DuplicateBridgeTeamSteele/0f0d0312569fb1d26d568e2b87d66ac160ac60c3/timpl/dropbox/tests/Trankings.lisp | lisp | The first four lines of this file were added by .
They tell that this is a Dracula Modular ACL2 program .
Leave these lines unchanged so that DrScheme can properly load this file .
#reader(planet "reader.ss" ("cce" "dracula.plt") "modular" "lang")
(require "../modules/Mbasiclex.lisp")
(require "../modules/Mran... | |
b325bb57979cccf0a3f333fe6fc79ca45e7f72517cae93a4373562556bcaf7d9 | kitlang/kit | ExprToType.hs | module Kit.Compiler.Typers.TypeExpression.ExprToType(exprToType) where
import Control.Monad
import Kit.Ast
import Kit.Compiler.Context
import Kit.Compiler.Module
import Kit.Compiler.TypeContext
exprToType
:: CompileContext
-> TypeContext
-> Module
-> Span
-> TypedExpr
-> IO (Maybe ConcreteType)
exprToType... | null | https://raw.githubusercontent.com/kitlang/kit/2769a7a8e51fe4466c50439d1a1ebdad0fb79710/src/Kit/Compiler/Typers/TypeExpression/ExprToType.hs | haskell | module Kit.Compiler.Typers.TypeExpression.ExprToType(exprToType) where
import Control.Monad
import Kit.Ast
import Kit.Compiler.Context
import Kit.Compiler.Module
import Kit.Compiler.TypeContext
exprToType
:: CompileContext
-> TypeContext
-> Module
-> Span
-> TypedExpr
-> IO (Maybe ConcreteType)
exprToType... | |
83b2ee66674e45d05cc5c86c4689bb285ee8ce17b5b25db56dc3aa67f08310c5 | tweag/ormolu | tricky-parens-out.hs | handleStuff =
( let foo = foo
in foo
)
| null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/declaration/value/function/tricky-parens-out.hs | haskell | handleStuff =
( let foo = foo
in foo
)
| |
a3faacc33eb47d285ae1454800d5c6242677b42c31635c3286d0d18aa2f27e95 | rpless/cover-coveralls | info.rkt | #lang setup/infotab
(define name "cover-coveralls")
(define collection 'multi)
(define version "0.1.0")
(define deps '(("base" #:version "6.1.1") "cover-lib"))
(define build-deps '("rackunit-lib"))
| null | https://raw.githubusercontent.com/rpless/cover-coveralls/a5bb101d934e72f49b3f583707c58b921d61c07c/info.rkt | racket | #lang setup/infotab
(define name "cover-coveralls")
(define collection 'multi)
(define version "0.1.0")
(define deps '(("base" #:version "6.1.1") "cover-lib"))
(define build-deps '("rackunit-lib"))
| |
69f3231e2da925b673392a6900d6ef46d0c4fdf52d50b836891f42e51a2241d0 | tweag/ormolu | double-shebangs.hs | #!/usr/bin/env stack
#!/usr/bin/env stack
| null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/module-header/double-shebangs.hs | haskell | #!/usr/bin/env stack
#!/usr/bin/env stack
| |
672a09f79dfe7dd97bbd3b288a1c27fb7c99ea5cf1b39db42a5f9f870de097fa | EdAyers/Robotone | TexBase.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
module TexBase (
,
texHeader, texFooter,
math,
escape,
operator,
scriptsize, footnotesize, small,
textbf, textrm, textsc, textit,
smalltextrm, smalltextit,
boldmath,
overline,
ensuremath, texableGreekLetters,... | null | https://raw.githubusercontent.com/EdAyers/Robotone/1cdcde674a54a47c382fef2b060d50b35361f120/src/TexBase.hs | haskell | --------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------- | # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
module TexBase (
,
texHeader, texFooter,
math,
escape,
operator,
scriptsize, footnotesize, small,
textbf, textrm, textsc, textit,
smalltextrm, smalltextit,
boldmath,
overline,
ensuremath, texableGreekLetters,... |
821bdd40490d482721d68e53c39339be8b6d1b89cb534b9c8d2f4f56c3b31489 | fpco/stackage-curator | UploadIndex.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE ViewPatterns #-}
module Stackage.Curator.UploadIndex
( uploadIndex
) where
import Data.Yaml (decodeFileEi... | null | https://raw.githubusercontent.com/fpco/stackage-curator/c25cf6959a1d1b3129b18855ddbc7974324cc422/src/Stackage/Curator/UploadIndex.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE OverloadedStrings #
# LANGUAGE ViewPatterns #
^ build plan
^ bucket
^ key prefix | # LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE RecordWildCards #
module Stackage.Curator.UploadIndex
( uploadIndex
) where
import Data.Yaml (decodeFileEither)
import Stackage.BuildConstraints
import Stackage.BuildPlan
import Stackage.Prelude
import Stackage.Pac... |
96ab46e8241d4694da590a2fd9c22a02a0e0fa1b05bcbd4799b28ecc7799e766 | mejgun/haskell-tdlib | SetChatMemberStatus.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.SetChatMemberStatus where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.ChatMemberStatus as ChatMemberStatus
import qualified TD.Data.MessageSender as MessageSender
import qualified Utils as U
-- |
-- Changes t... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/dc380d18d49eaadc386a81dc98af2ce00f8797c2/src/TD/Query/SetChatMemberStatus.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed
| The new status of th... |
module TD.Query.SetChatMemberStatus where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.ChatMemberStatus as ChatMemberStatus
import qualified TD.Data.MessageSender as MessageSender
import qualified Utils as U
data SetChatMemberStatus = SetChatMemberStatus
status... |
146f4b8ba9d4a2b1644389283fe1b7621d1d534a70506a753eeb11577b3488f7 | Opetushallitus/aipal | kysymysryhma.clj | Copyright ( c ) 2014 The Finnish National Board of Education - Opetushallitus
;;
This program is free software : Licensed under the EUPL , Version 1.1 or - as
soon as they will be approved by the European Commission - subsequent versions
of the EUPL ( the " Licence " ) ;
;;
;; You may not use this work except... | null | https://raw.githubusercontent.com/Opetushallitus/aipal/767bd14ec7153dc97fdf688443b9687cdb70082f/e2e/src/aipal_e2e/sivu/kysymysryhma.clj | clojure |
You may not use this work except in compliance with the Licence.
You may obtain a copy of the Licence at: /
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 | Copyright ( c ) 2014 The Finnish National Board of Education - Opetushallitus
This program is free software : Licensed under the EUPL , Version 1.1 or - as
soon as they will be approved by the European Commission - subsequent versions
European Union Public Licence for more details .
(ns aipal-e2e.sivu.kysymy... |
e80ba9dfae75de767b6c29b455db3ebb58ea49132c3e239a9f796f65dcad0e37 | hkuplg/fcore | CoreSpec.hs | module CoreSpec where
import Test.Hspec
import Core
-- `main` is here so that this module can be run from GHCi on its own. It is
-- not needed for automatic spec discovery.
main :: IO ()
main = hspec spec
-- /\A. /\B. \(x : A). \(y : B). x
konst :: Expr Int Int
konst = bLam (\a -> bLam (\b ->
lam (tVar a... | null | https://raw.githubusercontent.com/hkuplg/fcore/e27b6dec5bfd319edb8c3e90d94a993bcc7b4c95/testsuite/CoreSpec.hs | haskell | `main` is here so that this module can be run from GHCi on its own. It is
not needed for automatic spec discovery.
/\A. /\B. \(x : A). \(y : B). x
/\A. (x : A). x
describe "type application" $ do
mapM_ (\(name, input, expectedOutput) ->
]
describe "application" $ do
mapM_ (\(name, input, expectedOutpu... | module CoreSpec where
import Test.Hspec
import Core
main :: IO ()
main = hspec spec
konst :: Expr Int Int
konst = bLam (\a -> bLam (\b ->
lam (tVar a) (\x -> lam (tVar b) (\y -> var x))))
forall A. forall B - > A
typeOfKonst :: Type Int
typeOfKonst = Core.forall (\a -> Core.forall (\b -> tVar a `Fu... |
c3423b6297b2a975a8745e61c37707e1a28e923264739656eec75e8f8da23eb2 | ska80/thinlisp | struct-type.lisp | (in-package "L-SYSTEM")
;;; Module STRUCT-TYPE
Copyright ( c ) 1999 - 2001 The ThinLisp Group
Copyright , Artificial Creatures , Inc. , 1998
Copyright , IS Robotics , Inc. , 1998
This file is part of ThinLisp .
ThinLisp is open source ; you can redistribute it and/or modify it
under the terms of the Thi... | null | https://raw.githubusercontent.com/ska80/thinlisp/173573a723256d901887f1cbc26d5403025879ca/tlt/lisp/struct-type.lisp | lisp | Module STRUCT-TYPE
you can redistribute it and/or modify it
either version 1 or ( at your option ) any later version .
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Type Info for the L implementation
type-description :
Runtime data structure ... | (in-package "L-SYSTEM")
Copyright ( c ) 1999 - 2001 The ThinLisp Group
Copyright , Artificial Creatures , Inc. , 1998
Copyright , IS Robotics , Inc. , 1998
This file is part of ThinLisp .
under the terms of the ThinLisp License as published by the ThinLisp
ThinLisp is distributed in the hope that it wi... |
580f06dd9e0f439a2d835f09e72815131ecb05d4906f83a2132b95626ae78f0f | janestreet/hardcaml_verify | test_is_one_hot.ml | open Base
open Hardcaml_verify
let print_is_proved ?(verbose = true) eqn =
ignore (Solver.solve ~print_model:verbose Comb_gates.(cnf ~:eqn) : _ Or_error.t)
;;
let%expect_test "check onehot" =
let open Comb_gates in
let module Is_one_hot = Is_one_hot.Make (Comb_gates) in
let vec = input "vec" 8 in
let count ... | null | https://raw.githubusercontent.com/janestreet/hardcaml_verify/30a4c26f8913431d02c678af014eafecb501388a/test/test_is_one_hot.ml | ocaml | open Base
open Hardcaml_verify
let print_is_proved ?(verbose = true) eqn =
ignore (Solver.solve ~print_model:verbose Comb_gates.(cnf ~:eqn) : _ Or_error.t)
;;
let%expect_test "check onehot" =
let open Comb_gates in
let module Is_one_hot = Is_one_hot.Make (Comb_gates) in
let vec = input "vec" 8 in
let count ... | |
b4766aa075bb413a32a6bfd3eca1b7ad928acb8eec93c5e28b48603ca86dd3a4 | ryszard/clsql | transaction.lisp | -*- Mode : LISP ; Syntax : ANSI - Common - Lisp ; Base : 10 -*-
;;;; *************************************************************************
;;;;
$ Id$
;;;;
;;;; Transaction support
;;;;
This file is part of CLSQL .
;;;;
CLSQL users are granted the rights to distribute and use this software
as governed by t... | null | https://raw.githubusercontent.com/ryszard/clsql/9aafcb72bd7ca1d7e908938b6a5319753b3371d9/sql/transaction.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 -*-
*************************************************************************
Transaction support
(), also known as the LLGPL.
*************************************************************************
turn off autocommit for begin. then use sqlendtran (or maybe sqltra... | $ Id$
This file is part of CLSQL .
CLSQL users are granted the rights to distribute and use this software
as governed by the terms of the Lisp Lesser GNU Public License
(in-package #:clsql-sys)
(defclass transaction ()
((commit-hooks :initform () :accessor commit-hooks)
(rollback-hooks :initform () :acce... |
f26f0ee26f56a41aab81b851afea9a0b89b0d8d99dae0ad36f1da974f05f2ba0 | hyperfiddle/electric | form_pure_ct.cljc | (ns wip.form-pure-ct
(:require [contrib.clojurex :refer [bindx]]
[contrib.str :refer [pprint-str]]
#?(:clj [contrib.datomic-contrib :as dx])
#?(:clj [datomic.client.api :as d])
[hyperfiddle.api :as hf]
#?(:clj [hyperfiddle.txn :refer [minimal-tx]])
... | null | https://raw.githubusercontent.com/hyperfiddle/electric/1c6c3891cbf13123fef8d33e6555d300f0dac134/scratch/dustin/y2022/forms/form_pure_ct.cljc | clojure | colorless!
CT impulse, must feedback busy when handled | (ns wip.form-pure-ct
(:require [contrib.clojurex :refer [bindx]]
[contrib.str :refer [pprint-str]]
#?(:clj [contrib.datomic-contrib :as dx])
#?(:clj [datomic.client.api :as d])
[hyperfiddle.api :as hf]
#?(:clj [hyperfiddle.txn :refer [minimal-tx]])
... |
138c453afe319784539bc6485829e0be1431f1efa612d9910b09adf2eead50ff | racket/math | farey.rkt | #lang typed/racket/base
(require "types.rkt")
(provide farey-sequence mediant)
(: mediant : Exact-Rational Exact-Rational -> Exact-Rational)
(define (mediant x y)
(/ (+ (numerator x) (numerator y))
(+ (denominator x) (denominator y))))
(: farey-sequence : Integer -> (Listof Exact-Rational))
(define (farey-se... | null | https://raw.githubusercontent.com/racket/math/dcd2ea1893dc5b45b26c8312997917a15fcd1c4a/math-lib/math/private/number-theory/farey.rkt | racket | #lang typed/racket/base
(require "types.rkt")
(provide farey-sequence mediant)
(: mediant : Exact-Rational Exact-Rational -> Exact-Rational)
(define (mediant x y)
(/ (+ (numerator x) (numerator y))
(+ (denominator x) (denominator y))))
(: farey-sequence : Integer -> (Listof Exact-Rational))
(define (farey-se... | |
9ed8769ffaba78c1774d093447e787571fd5bc64e3b21c14f8eafa481619dc4e | jimpil/cryptohash-clj | equality.clj | (ns cryptohash-clj.equality)
(defn hash= ;; adapted from `crypto-equality`
"Test whether two sequences of characters/bytes are equal in a way that
protects against timing attacks. Early aborting occurs if one/both
arguments are nil (one => false, both => true), or if the sequences
are found to be of differ... | null | https://raw.githubusercontent.com/jimpil/cryptohash-clj/5ea9e4abb83065d044ea7471ed7e86b85450e300/src/cryptohash_clj/equality.clj | clojure | adapted from `crypto-equality`
both nil => true
ensure equal lengths before comparison | (ns cryptohash-clj.equality)
"Test whether two sequences of characters/bytes are equal in a way that
protects against timing attacks. Early aborting occurs if one/both
arguments are nil (one => false, both => true), or if the sequences
are found to be of different lengths. Note that, the latter can allow
... |
c9e689fcf0c18f394123113179e156843dd663cb18165e63dc092e612612dd1b | privet-kitty/cl-competitive | jonker-volgenant.lisp | (defpackage :cp/jonker-volgenant
(:use :cl)
(:export #:solve-lap-jp #:+lap-null-vertex+ #:+lap-null-weight+
#:lap #:make-lap #:%lap-size1 #:%lap-size2 #:%lap-matching1 #:%lap-matching2
#:lap-p #:lap-add-edge #:lap-build #:lap-score)
(:documentation "Provides Jonker-Volgenant algorithm for a ... | null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/cd1ec4e945582ad6f550b696eaa7e0c3be5a0865/module/jonker-volgenant.lisp | lisp | rowsol[i] = column assigned to row i
colsol[j] = row assigned to column j
dual variables (reduced values w.r.t. column)
stores unassigned rows
stores columns to be scanned
counts how many times a row could be assigned
shortest distance in the (residual) network
row-predecessor of column in an augmenting path
C... | (defpackage :cp/jonker-volgenant
(:use :cl)
(:export #:solve-lap-jp #:+lap-null-vertex+ #:+lap-null-weight+
#:lap #:make-lap #:%lap-size1 #:%lap-size2 #:%lap-matching1 #:%lap-matching2
#:lap-p #:lap-add-edge #:lap-build #:lap-score)
(:documentation "Provides Jonker-Volgenant algorithm for a ... |
43292a39ccf91d3d053c6f8c85f6202ead807e46a1f95d4b6fed19ca5f2eea7c | CREATe-centre/sociaml-tumblr-api | auth.ml | module type S = sig
module Client : Sociaml_oauth_client_v1_0a.Client.S
val fetch_request_token :
consumer_key : string ->
consumer_secret : string ->
(Client.request_token, Client.error) Core_kernel.Result.t Lwt.t
val fetch_access_token :
request_token : Client.request_token ->
v... | null | https://raw.githubusercontent.com/CREATe-centre/sociaml-tumblr-api/0d90ba119ce8ce0663fe605688eca2bbee35d549/src/auth.ml | ocaml | module type S = sig
module Client : Sociaml_oauth_client_v1_0a.Client.S
val fetch_request_token :
consumer_key : string ->
consumer_secret : string ->
(Client.request_token, Client.error) Core_kernel.Result.t Lwt.t
val fetch_access_token :
request_token : Client.request_token ->
v... | |
35414ebdb552a9a91abc5731fb6dc1d6244d165f3ca25c63809562c3f0fd740d | dongcarl/guix | hurd.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2020 < >
Copyright © 2020 Jan ( janneke ) Nieuwenhuizen < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the F... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/gnu/system/hurd.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2020 < >
Copyright © 2020 Jan ( janneke ) Nieuwenhuizen < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu system hurd)
#:use-module (guix gexp)
... |
ada3b60e25e7bf9346d9beeda2612b3885395c50ed6cd9f944388b0148dae302 | matijapretnar/eff | const.mli | type t = private
| Integer of int
| String of string
| Boolean of bool
| Float of float
type ty = IntegerTy | StringTy | BooleanTy | FloatTy
type comparison = Less | Equal | Greater | Invalid
val of_integer : int -> t
val of_string : string -> t
val of_boolean : bool -> t
val of_float : float -> t
val of... | null | https://raw.githubusercontent.com/matijapretnar/eff/d1a0405ed6c1ffe4ceb872d05994ac817300d9fd/src/01-language/const.mli | ocaml | type t = private
| Integer of int
| String of string
| Boolean of bool
| Float of float
type ty = IntegerTy | StringTy | BooleanTy | FloatTy
type comparison = Less | Equal | Greater | Invalid
val of_integer : int -> t
val of_string : string -> t
val of_boolean : bool -> t
val of_float : float -> t
val of... | |
3bc9584d027c6592acfd288e22c1095af2eac68b42b6ff90ba324c1f0de66c5a | wlitwin/graphv | scissor.ml | type t = {
xform : Matrix.t;
extent_0 : float;
extent_1 : float;
}
let create() = {
xform = Matrix.create();
extent_0 = ~-.1.;
extent_1 = ~-.1.;
}
let copy t = {
t with xform = Matrix.copy t.xform
}
| null | https://raw.githubusercontent.com/wlitwin/graphv/d0a09575c5ff5ee3727c222dd6130d22e4cf62d9/webgl1/core/scissor.ml | ocaml | type t = {
xform : Matrix.t;
extent_0 : float;
extent_1 : float;
}
let create() = {
xform = Matrix.create();
extent_0 = ~-.1.;
extent_1 = ~-.1.;
}
let copy t = {
t with xform = Matrix.copy t.xform
}
| |
a7c15e3c7c85c25b19f734fa03decbb1eef4fa4a169a4dbd55908f93f297dc7c | mmontone/gestalt | todo.lisp | Consider defining a code walker protocol using the MOP machinery
;; Here is an sketch:
;; Consider make-method-lambda for declaring a walker's special functions.
(in-package :gst.util)
(defclass walker-generic-function-class (funcallable-standard-class)
())
(define-condition walker-function-definition-error ()... | null | https://raw.githubusercontent.com/mmontone/gestalt/fd019c0ca03b4efc73b9ddd3db1e3ed211233428/deps/util/todo.lisp | lisp | Here is an sketch:
Consider make-method-lambda for declaring a walker's special functions.
The cases should be evaluated in order
A constant or keyword
A lexical variable
A dynamic variable
A free variable
A lambda expression
A let expression
A let* expression
An flet expression
A labels expression
walker ... | Consider defining a code walker protocol using the MOP machinery
(in-package :gst.util)
(defclass walker-generic-function-class (funcallable-standard-class)
())
(define-condition walker-function-definition-error ()
())
(defmacro def-walker-case (case args &body body)
"We want walker functions to be define... |
a847b5d91e2aba37e42aeebf9fc417d6ef6a8bcdcacafeef788bebbc01dd52a7 | gothinkster/clojurescript-keechma-realworld-example-app | editor_form.cljs | (ns app.controllers.user.editor-form
(:require [keechma.next.controller :as ctrl]
[keechma.next.controllers.pipelines :as pipelines]
[keechma.pipelines.core :as pp :refer-macros [pipeline!]]
[app.api :as api]
[promesa.core :as p]
[keechma.next.controllers.fo... | null | https://raw.githubusercontent.com/gothinkster/clojurescript-keechma-realworld-example-app/f6d32f8eea5439b0b33df1afb89da6d27b7da66b/src/app/controllers/user/editor_form.cljs | clojure | (ns app.controllers.user.editor-form
(:require [keechma.next.controller :as ctrl]
[keechma.next.controllers.pipelines :as pipelines]
[keechma.pipelines.core :as pp :refer-macros [pipeline!]]
[app.api :as api]
[promesa.core :as p]
[keechma.next.controllers.fo... | |
baa2ad4ad6db139484121f9b5755ddcb02d361c7279c17ff93843b1e1b3df658 | josephwilk/musical-creativity | apprentice.clj | (ns musical-creativity.composers.apprentice
(:require
[clojure.string :as string]
[clojure.math.numeric-tower :as math]
[musical-creativity.util :refer [position choose-one third frequency]]))
(def weight-divisor 2)
(def keyword-weight 0.75)
(def successor-weight 0.5)
(def backward-chain-weight 0.1)
(def la... | null | https://raw.githubusercontent.com/josephwilk/musical-creativity/c2e6aab2a26d69ee2e51f4fad84fa3a71805e6ca/src/musical_creativity/composers/apprentice.clj | clojure | (ns musical-creativity.composers.apprentice
(:require
[clojure.string :as string]
[clojure.math.numeric-tower :as math]
[musical-creativity.util :refer [position choose-one third frequency]]))
(def weight-divisor 2)
(def keyword-weight 0.75)
(def successor-weight 0.5)
(def backward-chain-weight 0.1)
(def la... | |
42c767adf4f2ef782a0eb5856b9762aed531a78a65fd04ad56fffda462aeb24e | Mesabloo/nihil | Unification.hs | # LANGUAGE MultiParamTypeClasses #
module Nihil.TypeChecking.Unification where
import Nihil.TypeChecking.Substitution
import Nihil.Utils.Impossible
import Nihil.TypeChecking.Common
| A type class for unifiable values .
values include ─ but are not limited to ─ types and kinds .
The @'unify'@ function ... | null | https://raw.githubusercontent.com/Mesabloo/nihil/3821052ca5691a6492b23bd8a46bfe70567d374f/src/typechecker/Nihil/TypeChecking/Unification.hs | haskell | # LANGUAGE MultiParamTypeClasses #
module Nihil.TypeChecking.Unification where
import Nihil.TypeChecking.Substitution
import Nihil.Utils.Impossible
import Nihil.TypeChecking.Common
| A type class for unifiable values .
values include ─ but are not limited to ─ types and kinds .
The @'unify'@ function ... | |
123f132525b287319c8c6e34cd3e8fc6033b54ee3e04f46f3ad8192a7fbf7841 | antifuchs/autobench | package.lisp | (cl:defpackage #:autobench
(:use #:cl #:postmodern #:alexandria #:iterate
#+sbcl #:sb-md5
#-sbcl #:md5)
(:export #:build-and-benchmark #:benchmark-versions #:process-benchmark-data
#:connect-to-database #:md5-pathname-component
#:import-release-from-dir
;; implementa... | null | https://raw.githubusercontent.com/antifuchs/autobench/acc14ee2a8899cb630aa8dd02f3ffd7f5858ce28/lisp/package.lisp | lisp | implementations
arch-tag: "2523ee5c-ff5f-11d8-8b1b-000c76244c24" | (cl:defpackage #:autobench
(:use #:cl #:postmodern #:alexandria #:iterate
#+sbcl #:sb-md5
#-sbcl #:md5)
(:export #:build-and-benchmark #:benchmark-versions #:process-benchmark-data
#:connect-to-database #:md5-pathname-component
#:import-release-from-dir
#:sbcl #:sbcl... |
67575f4669a34d36523b384d2788b753d24b7db9c1d022be3b511e728434797d | Mayvenn/storefront | checkout_complete.cljs | (ns storefront.components.checkout-complete
(:require [mayvenn.concept.awareness :as awareness]
[mayvenn.visual.tools :refer [with]]
[storefront.components.svg :as svg]
[storefront.accessors.categories :as categories]
[storefront.api :as api]
api.orders
... | null | https://raw.githubusercontent.com/Mayvenn/storefront/0499cc770386d7a603b64f8e2548bcf6fc0f5a8f/src-cljs/storefront/components/checkout_complete.cljs | clojure | Discountable promotions
Feature flags | (ns storefront.components.checkout-complete
(:require [mayvenn.concept.awareness :as awareness]
[mayvenn.visual.tools :refer [with]]
[storefront.components.svg :as svg]
[storefront.accessors.categories :as categories]
[storefront.api :as api]
api.orders
... |
d16d9071f8659b1a91e060af5a6c77565d4abc17f3b007ecaecfa4f6990d7227 | helium/plumtree | plumtree_broadcast_handler.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2013 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may ob... | null | https://raw.githubusercontent.com/helium/plumtree/3ef02920bd1e31dd8d9b5d9ca88f49639036ad9b/src/plumtree_broadcast_handler.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2013 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(... |
673713631a199228180d39c9a0782c208221c509b3a9e57929f08fade98c7123 | modular-macros/ocaml-macros | testing.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/testsuite/lib/testing.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 2006 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
val test : bool -> unit;;
val failure_test : ('a -> 'b) -> 'a -> string -> bool;;
val test_raises_some... |
911fd31656bd3d5172ca74381b8f55d5c60996d872bec1b490e5ea1a72b662de | dardoria/ponon | repeat-embedded.lisp | ;; Original file info:
;; Repeat: Embedded Iteration
from Form+Code in Design , Art , and Architecture
by , , and LUST
Princeton Architectural Press , 2010
ISBN 9781568989372
;;
;; This code was written for Processing 1.2+
;; Get Processing at
;;
This is a Common Lisp implementation of an example from ... | null | https://raw.githubusercontent.com/dardoria/ponon/f62d285da2a9a86c9f2dff8578bde61f52b97ab9/examples/formandcode/repeat-embedded.lisp | lisp | Original file info:
Repeat: Embedded Iteration
This code was written for Processing 1.2+
Get Processing at
Option 1: Stitches
Option 2: Perspective
Option 3: Overlapping circles
Option 4: Rotating arcs | from Form+Code in Design , Art , and Architecture
by , , and LUST
Princeton Architectural Press , 2010
ISBN 9781568989372
This is a Common Lisp implementation of an example from the Book Form And Code .
This implementation requires ponon -
(in-package :formandcode-examples)
(defclass repeat-embedded ... |
fadd0a09dc3b2760f3ee0e9bb57524e0361ee1f4229a744de0827f2158e2911b | haroldcarr/learn-haskell-coq-ml-etc | Trie.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
module Trie
(Trie, Digest, runTrie)
where
import PPrelude
import TrieInternal as TI
import Control.Monad.State
import Prelude hiding (lookup)
insert :: Ref -> ByteString -> B... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/playpen/blockchain/ben-kirwin-merkle/src/Trie.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
module Trie
(Trie, Digest, runTrie)
where
import PPrelude
import TrieInternal as TI
import Control.Monad.State
import Prelude hiding (lookup)
insert :: Ref -> ByteString -> B... | |
9112a7261fbc182b932fbab810ef544b363cea9e751390f1dbe57d160d346d0b | atolab/zenoh | z_addstorage.ml |
* Copyright ( c ) 2017 , 2020 ADLINK Technology Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* -2.0 , or the Apache License , Version 2.0
* which is available at -2.0 .
*
* SPDX - License - Ident... | null | https://raw.githubusercontent.com/atolab/zenoh/32e311aae6be93c001fd725b4d918b2fb4e9713d/example/zenoh/z_addstorage.ml | ocaml |
* Copyright ( c ) 2017 , 2020 ADLINK Technology Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* -2.0 , or the Apache License , Version 2.0
* which is available at -2.0 .
*
* SPDX - License - Ident... | |
d2bbb3f6f839578d53c93ee17dc631c81d5bd6f9a2414ef812f874b02d8665b5 | RJ/logtail | logtail_tailer_sup.erl | -module(logtail_tailer_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
{ok, {{simple_one_for_one, 0, 1},
[{logtail_tail_file, {logtail_tail_file, start_link, []},
temporary, bruta... | null | https://raw.githubusercontent.com/RJ/logtail/796da2b025d926f6d3273b7892e6dd7bfbbc8479/src/logtail_tailer_sup.erl | erlang | -module(logtail_tailer_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
{ok, {{simple_one_for_one, 0, 1},
[{logtail_tail_file, {logtail_tail_file, start_link, []},
temporary, bruta... | |
d2ef72b848d00b9f5853715511cece3409de83864389414c5cbebfc8ca40248c | GaloisInc/ivory | BitShift.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE DataKinds #
--------------------------------------------------------------------------------
( c ) Galois , Inc. 2014 .
-- All rights reserved.
-- | Check for undefined bitshift behavior. Bit-shifts on signed ints are
-- already disallowed. This... | null | https://raw.githubusercontent.com/GaloisInc/ivory/53a0795b4fbeb0b7da0f6cdaccdde18849a78cd6/ivory-opts/src/Ivory/Opts/BitShift.hs | haskell | ------------------------------------------------------------------------------
All rights reserved.
| Check for undefined bitshift behavior. Bit-shifts on signed ints are
already disallowed. This check is that we bit-shift by strictly less than n
for an n-bit value.
-------------------------------------------------... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE DataKinds #
( c ) Galois , Inc. 2014 .
module Ivory.Opts.BitShift
( bitShiftFold
) where
import Ivory.Opts.AssertFold
import qualified Ivory.Language.Syntax.AST as I
import qualified Ivory.Language.Syntax.Type as I
import Ivory.Languag... |
fa2462dfef86f4b69de38c17ec0926acced97af4b024992550830f82e90d3d05 | inria-parkas/sundialsml | ark_KrylovDemo_prec.ml | -----------------------------------------------------------------
* Programmer(s ): @ SMU
* ---------------------------------------------------------------
* OCaml port : , , Jan 2016 .
* --------------------------------------------------------------------
* Copyright ( c ) 2015 , Southern Methodis... | null | https://raw.githubusercontent.com/inria-parkas/sundialsml/a72ebfc84b55470ed97fbb0b45d700deebfc1664/examples/arkode/C_serial/ark_KrylovDemo_prec.ml | ocaml | Constants
Problem Specification Constants
EE = e
GG = g
BB = b
Method Constants
ARKodeInit Constants
Output Constants
Note: The value for species i at mesh point (j,k) is stored in
component number (i-1) + j*NS + k*NS*MX of an N_Vector,
Structure for user data
Private Helper Functions
Sm... | -----------------------------------------------------------------
* Programmer(s ): @ SMU
* ---------------------------------------------------------------
* OCaml port : , , Jan 2016 .
* --------------------------------------------------------------------
* Copyright ( c ) 2015 , Southern Methodis... |
e14583663dc36bb6a3e96f9792eddc3defbc845775b28b90b7d9da56b7a693c6 | montelibero-org/veche | Base.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ImportQualifiedPost #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANG... | null | https://raw.githubusercontent.com/montelibero-org/veche/14908faa0a4a27b7d3742f0d1acecddaeaa25dd2/veche-web/src/Foundation/Base.hs | haskell | # LANGUAGE OverloadedStrings #
global
component
| 'Static' variant for `.well-known` directory
| The foundation datatype for your application. This can be a good place to
keep settings and values requiring initialization before your application
starts running, such as database connections. Every handler will have... | # LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ImportQualifiedPost #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns #
module Foundat... |
1a37630c429cf392471d2d61d1e0b67e2ff886af82c8134ff4b301dd51d8e469 | zachgk/catln | Runtime.hs | --------------------------------------------------------------------
-- |
-- Module : Eval.Runtime
Copyright : ( c ) 2019
License : MIT
-- Maintainer:
-- Stability : experimental
-- Portability: non-portable
--
-- This module defines additional functions that are added to the
-- program as the primi... | null | https://raw.githubusercontent.com/zachgk/catln/43429f5e85af22a7eefe97699f80dfe831f2798e/src/Eval/Runtime.hs | haskell | ------------------------------------------------------------------
|
Module : Eval.Runtime
Maintainer:
Stability : experimental
Portability: non-portable
This module defines additional functions that are added to the
program as the primitives. The declarations of these functions
-------------------------... | Copyright : ( c ) 2019
License : MIT
are in the Catln core . The function are executed in the interpreter
by executing the backing functions .
# LANGUAGE NamedFieldPuns #
module Eval.Runtime where
import qualified Data.HashMap.Strict as H
import Semantics.Prgm
import Semantics.Ty... |
5ea0de12c11224378c9599129e16a1707d6b3d6c7c727ee09f79d2a4a8cbd83d | mmottl/gsl-ocaml | fit.ml | gsl - ocaml - OCaml interface to GSL
Copyright ( © ) 2002 - 2012 - Olivier Andrieu
Distributed under the terms of the GPL version 3
let () = Error.init ()
type linear_fit_coeffs = {
c0 : float; c1 : float;
cov00 : float ; cov01 : float ; cov11 : float;
... | null | https://raw.githubusercontent.com/mmottl/gsl-ocaml/76f8d93cccc1f23084f4a33d3e0a8f1289450580/src/fit.ml | ocaml | gsl - ocaml - OCaml interface to GSL
Copyright ( © ) 2002 - 2012 - Olivier Andrieu
Distributed under the terms of the GPL version 3
let () = Error.init ()
type linear_fit_coeffs = {
c0 : float; c1 : float;
cov00 : float ; cov01 : float ; cov11 : float;
... | |
df614082678693b4fc3a8733d9d6ab9a955b0c96b94e27756ae711a77932ebd3 | j-mie6/ParsleyHaskell | InputCharacteristic.hs | |
Module : Parsley . Internal . Backend . Machine . Types . InputCharacteristic
Description : Packaging of offsets and positions .
License : BSD-3 - Clause
Maintainer : : experimental
This module contains the ` InputCharacteristic ` datatype , that describes how bindings consume input .
... | null | https://raw.githubusercontent.com/j-mie6/ParsleyHaskell/045ab78ed7af0cbb52cf8b42b6aeef5dd7f91ab2/parsley-core/src/ghc/Parsley/Internal/Backend/Machine/Types/InputCharacteristic.hs | haskell | ^ On all paths, input must be consumed: `Nothing` when the extact
amount is inconsistent across paths.
^ On all paths, no input is consumed.
^ The input characteristic is unknown or inconsistent. | |
Module : Parsley . Internal . Backend . Machine . Types . InputCharacteristic
Description : Packaging of offsets and positions .
License : BSD-3 - Clause
Maintainer : : experimental
This module contains the ` InputCharacteristic ` datatype , that describes how bindings consume input .
... |
ce0799548791e52859dcce49460b592ed70b0d5a1cc72b435d88de5c19ab7edb | jkrukoff/partial | partial.erl | %%%-------------------------------------------------------------------
%%% @doc
%%% A parse transform implementing partial function application.
%%%
%%% To enable, add to the top of your module:
%%%
%%% ```
%%% -compile({parse_transform, partial}).
%%% '''
%%%
%%% This will enable compile time conversion of calls to
... | null | https://raw.githubusercontent.com/jkrukoff/partial/564ae79b1147235e17be64d64b8c7ae2504b94b8/src/partial.erl | erlang | -------------------------------------------------------------------
@doc
A parse transform implementing partial function application.
To enable, add to the top of your module:
```
-compile({parse_transform, partial}).
'''
This will enable compile time conversion of calls to
application of the contained funct... | ` partial : cut/1 ' and ` partial : ' into partial function
the unevaluated slot(s ) in the contained function .
With ` partial : cut/1 ' , the arguments to the called function are
` partial : ' , the arguments are evaluated when the function is
To enable transforming ` cut/1 ' and ` cute/1 ' the same as th... |
eed6b051759ca29d52a8e71ec1d23bc965d8c45fc3ca52c035a88368ef571383 | diku-dk/futhark | Simplify.hs | # LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - orphans #
module Futhark.IR.GPU.Simplify
( simplifyGPU,
simplifyLambda,
GPU,
-- * Building blocks
simplifyKernelOp,
)
where
import Futhark.Analysis.SymbolTable qualified as ST
import Futhark.Analysis.UsageTable qualified as UT
import Futhark.I... | null | https://raw.githubusercontent.com/diku-dk/futhark/174e8d862def6f52d5c9a36fa3aa6e746049776e/src/Futhark/IR/GPU/Simplify.hs | haskell | * Building blocks
Figure out which of the names in 'pat' are used...
If they are not all used, then this rule applies.
return value bindings. Note that this leaves dead code in the
kernel, but that will be removed later.
If we see an Update with a scalar where the value to be written is
the result of indexing s... | # LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - orphans #
module Futhark.IR.GPU.Simplify
( simplifyGPU,
simplifyLambda,
GPU,
simplifyKernelOp,
)
where
import Futhark.Analysis.SymbolTable qualified as ST
import Futhark.Analysis.UsageTable qualified as UT
import Futhark.IR.GPU
import Futhark.IR.S... |
ff8670041728f0f4ea7ccd1c0e689485d0b3834808a020d8a637e51ffdf13209 | diffusionkinetics/open | Example.hs | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE OverloadedStrings , ExistentialQuantification , ScopedTypeVariables ,
ExtendedDefaultRules , FlexibleContexts , TemplateHaskell , MultiParamTypeClasses ,
OverloadedLabels , TypeOperators , DataKinds , DeriveGeneric , FlexibleInstances #
ExtendedDefaultRule... | null | https://raw.githubusercontent.com/diffusionkinetics/open/673d9a4a099abd9035ccc21e37d8e614a45a1901/youido/examples/Example.hs | haskell | DL.inputWithType typ_ attrs fieldName view)
------------------------------------------------
------------------------------------------------
readTodoState :: ExampleM TodoList
------------------------------------------------
------------------------------------------------ | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE OverloadedStrings , ExistentialQuantification , ScopedTypeVariables ,
ExtendedDefaultRules , FlexibleContexts , TemplateHaskell , MultiParamTypeClasses ,
OverloadedLabels , TypeOperators , DataKinds , DeriveGeneric , FlexibleInstances #
ExtendedDefaultRule... |
848d9d56570f42288e9770048b7dbbb448b136d9a0f63198de8654fed543beb1 | pol-is/polisMath | ptpt_stats_test.clj | Copyright ( C ) 2012 - present , The Authors . This program is free software : you can redistribute it and/or modify it under the terms of the GNU Affero General Public License , version 3 , as published by the Free Software Foundation . This program is distributed in the hope that it will be useful , but WITHOUT A... | null | https://raw.githubusercontent.com/pol-is/polisMath/dfe233e8c9207c2ce11e1379286ad0cf0f732067/test/ptpt_stats_test.clj | clojure | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU Affero General Public License for more details . You should have received a copy of the GNU Affero General Public License along with this program . If not , see < / > .
(:use test-helpers) |
(ns ptpt-stats-test
(:require [clojure.test :refer [deftest testing is]]
[polismath.math.named-matrix :as nm]
[polismath.math.repness :as repness]))
(deftest test-participant-stats
(testing "should generally be sane"
(let [group-clusters [{:id 1 :members [1 2]}
... |
5e089504cea3bf6ed6a27620da1a743468b54863f7e3ae60bf456b050f04f6a0 | gtk2hs/gtk2hs | GtkChap6-1.hs | import Graphics.UI.Gtk
import Data.IORef
import System.Random (randomRIO)
main:: IO ()
main= do
initGUI
window <- windowNew
set window [ windowTitle := "Guess a Number",
windowDefaultWidth := 300, windowDefaultHeight := 250]
mb <- vBoxNew False 0
containerAdd window mb
... | null | https://raw.githubusercontent.com/gtk2hs/gtk2hs/0f90caa1dae319a0f4bbab76ed1a84f17c730adf/docs/tutorial/Tutorial_Port/Example_Code/GtkChap6-1.hs | haskell | import Graphics.UI.Gtk
import Data.IORef
import System.Random (randomRIO)
main:: IO ()
main= do
initGUI
window <- windowNew
set window [ windowTitle := "Guess a Number",
windowDefaultWidth := 300, windowDefaultHeight := 250]
mb <- vBoxNew False 0
containerAdd window mb
... | |
2504c833cb3cb2c6f34b31e916e8a162f493ef5742e4996dfa8e26a3e43e4f93 | pingles/googlecloud | coerce.clj | (ns googlecloud.bigquery.coerce
(:require [googlecloud.core :as gc]
[clojure.walk :as walk])
(:import [com.google.api.services.bigquery.model JobList Job JobConfigurationLoad JobConfigurationExtract JobConfigurationQuery JobConfiguration JobStatus JobStatistics JobList$Jobs JobReference GetQueryResultsR... | null | https://raw.githubusercontent.com/pingles/googlecloud/8d31afb1c627d40f7293f85c479cbfa98317b056/bigquery/src/googlecloud/bigquery/coerce.clj | clojure | (ns googlecloud.bigquery.coerce
(:require [googlecloud.core :as gc]
[clojure.walk :as walk])
(:import [com.google.api.services.bigquery.model JobList Job JobConfigurationLoad JobConfigurationExtract JobConfigurationQuery JobConfiguration JobStatus JobStatistics JobList$Jobs JobReference GetQueryResultsR... | |
9b67961877e7461eb0dbf733f69791831061f31148dc7ee98d65d460216ea2c0 | crategus/cl-cffi-gtk | application-simple.lisp | ;;;; Simple Application - 2021-10-7
(in-package :gtk-application)
(defun application-simple (&rest argv)
(let (;; Create an application
(app (make-instance 'gtk-application
:application-id "com.crategus.application-simple"
:flags :none)))
Connect sig... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/7f5a09f78d8004a71efa82794265f2587fff98ab/demo/gtk-application/application-simple.lisp | lisp | Simple Application - 2021-10-7
Create an application
Create an application window
Show the application window
Run the application |
(in-package :gtk-application)
(defun application-simple (&rest argv)
(app (make-instance 'gtk-application
:application-id "com.crategus.application-simple"
:flags :none)))
Connect signal " activate " to the application
(g-signal-connect app "activa... |
eff7cca534a4c30cf1ef28e1ccc7f0f15cb7a32ed4626ccd80dca043741f0486 | clojure-interop/google-cloud-clients | InstanceAdminStubSettings.clj | (ns com.google.cloud.spanner.admin.instance.v1.stub.InstanceAdminStubSettings
"Settings class to configure an instance of InstanceAdminStub.
The default instance has everything set to sensible defaults:
The default service address (spanner.googleapis.com) and default port (443) are used.
Credentials are ... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.spanner/src/com/google/cloud/spanner/admin/instance/v1/stub/InstanceAdminStubSettings.clj | clojure |
" | (ns com.google.cloud.spanner.admin.instance.v1.stub.InstanceAdminStubSettings
"Settings class to configure an instance of InstanceAdminStub.
The default instance has everything set to sensible defaults:
The default service address (spanner.googleapis.com) and default port (443) are used.
Credentials are ... |
a7cfd9af51582841a0592f817ac140a18e4d293eb868e8b6c8aa67999afb4446 | lukexi/halive | TestFileFoo.hs | module Foo where
foo = "Here's foo"
| null | https://raw.githubusercontent.com/lukexi/halive/cae5b327730bcea5ef25bb05e5a12a283eade97d/test/TestFileFoo.hs | haskell | module Foo where
foo = "Here's foo"
| |
2a1a5e9875586ee05ead567650c435fc6b8c7093be31b356f5f153cfa782d8bd | dgiot/dgiot | dgiot_product_csv.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2021 DGIOT 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... | null | https://raw.githubusercontent.com/dgiot/dgiot/a8c41d83b85d42c63057e020985a56b777e9a4e4/apps/dgiot_device/src/utils/dgiot_product_csv.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 - 2021 DGIOT 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(dgiot_product_csv).
-author("kenneth").
-include("dgiot_device.hrl").
-include_lib("dg... |
8613aeb62e095fbe7fc2b28131d293fd79854ed5213660f772939cdfdf0b38b1 | project-oak/hafnium-verification | clang_ast_extend.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/clang/clang_ast_extend.ml | ocaml | Type pointers
enable warning here to warn and update comparison funtion when new field is added |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
fba5710c93ccbf2fb77a28fbd7e9beb38c21c11fc096c7bc0c3c603863fd4395 | imandra-ai/fix-engine | t_fix_io.ml | module Encode = struct
let encode_ref ~split msg =
let split = String.make 1 split in
msg
|> List.map (fun (k, v) -> k ^ "=" ^ v)
|> List.fold_left (fun a s -> a ^ s ^ split) ""
let check_same ~split s =
let msg1 = encode_ref ~split s in
let msg2 = Fix_io.encode ~split s in
if msg1 <> m... | null | https://raw.githubusercontent.com/imandra-ai/fix-engine/42f3c4f3ca432469969e89e461ca76b52c21f282/tests/unit/engine/t_fix_io.ml | ocaml | a list of messages to test
small buffer size to test the resize/refill
test a k/v pair that is longer than the buffer
test a k/v pair that is longer than the buffer
test long sequence of messages
repeat [test_data] many times | module Encode = struct
let encode_ref ~split msg =
let split = String.make 1 split in
msg
|> List.map (fun (k, v) -> k ^ "=" ^ v)
|> List.fold_left (fun a s -> a ^ s ^ split) ""
let check_same ~split s =
let msg1 = encode_ref ~split s in
let msg2 = Fix_io.encode ~split s in
if msg1 <> m... |
1e5d298360378d98de1bc7fd04bbb17eca07a614fb47a33d21fefc4051814ac9 | tsloughter/rebar3_tests | relup_test_sup.erl | %%%-------------------------------------------------------------------
%% @doc relup_test top level supervisor.
%% @end
%%%-------------------------------------------------------------------
-module(relup_test_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE).
star... | null | https://raw.githubusercontent.com/tsloughter/rebar3_tests/090bfef7d3a4790bb6b16e4c38df6e4c0460b4b2/relup_test/apps/relup_test/src/relup_test_sup.erl | erlang | -------------------------------------------------------------------
@doc relup_test top level supervisor.
@end
-------------------------------------------------------------------
sup_flags() = #{strategy => strategy(), % optional
intensity => non_neg_integer(), % optional
optional
child_sp... |
-module(relup_test_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE).
start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
init([]) ->
SupFlags = #{strategy => one_for_all,
intensity => 0,
period => 1},
... |
eb94e986aa45d43ab34f710fef82cb58c7db4d69533ecbc1087b175367c1f5f3 | SimulaVR/godot-haskell | EditorImportPlugin.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Tools.EditorImportPlugin
(Godot.Tools.EditorImportPlugin.... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Tools/EditorImportPlugin.hs | haskell | # NOINLINE bindEditorImportPlugin_get_import_order #
| Gets the order of this importer to be run when importing resources. Higher values will be called later. Use this to ensure the importer runs after the dependencies are already imported.
| Gets the order of this importer to be run when importing resources. Higher ... | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Tools.EditorImportPlugin
(Godot.Tools.EditorImportPlugin.... |
832cfb481288e90d9ff08e113faeb096db5d96016fbc345778c5e4e10e1a3762 | binsec/haunted | stat_analysis.ml | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2016 - 2019
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/haunted/7ffc5f4072950fe138f53fe953ace98fff181c73/src/dynamic/examples/stat_analysis.ml | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2016 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
2947ade9c99f60b47d21a0ed15047f7b8080d27f5d2cc83bc892541820f2ce7b | ocurrent/opam-health-check | backend.mli | include Oca_server.Backend_intf.S
| null | https://raw.githubusercontent.com/ocurrent/opam-health-check/af0b4f1e66738ef22d5234ad239a247f99075750/server/backend/backend.mli | ocaml | include Oca_server.Backend_intf.S
| |
5646784aa1aff80e18f248fff074134e794f8fbc019b9129483d9009bd216eed | haskellari/strict | Lens.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE StandaloneDeriving #-}
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno -... | null | https://raw.githubusercontent.com/haskellari/strict/4691acdfbe95dcd49725baec09127fa0077d93ba/strict-lens/src/Data/Strict/Lens.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE DeriveGeneric #
# LANGUAGE StandaloneDeriving #
* Tuple
* Either
* Maybe
* These
Lazy variants
-----------------------------------------------------------------------------
Tuple
-------------------------------------------... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - orphans #
module Data.Strict.Lens (
| See instances , in particular for ' Field1 ' and ' Field2 ' type classes .
_Left, _Right,
_Just, _No... |
967d10e046dc73e3c0f7ba65b7a8214ad04242dbc62c4562425c2253d5c2be94 | lspitzner/brittany | Test394.hs | -- brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft }
-- a
func -- b
:: -- c
a -- d
-> -- e
( -- f
c -- g
, -- h
d -- i
) -- j-- k
| null | https://raw.githubusercontent.com/lspitzner/brittany/a15eed5f3608bf1fa7084fcf008c6ecb79542562/data/Test394.hs | haskell | brittany { lconfig_columnAlignMode: { tag: ColumnAlignModeDisabled }, lconfig_indentPolicy: IndentPolicyLeft }
a
b
c
d
e
f
g
h
i
j-- k | |
206a74b33d085705d5e8ef54e8431392fb687e31917c3a2903216c08726861b7 | outergod/cl-m4 | m4-composite.lisp | ;;;; cl-m4 - m4-composite.lisp
Copyright ( C ) 2010 < >
This file is part of cl - m4 .
;;;; cl-m4 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the License , or
;;;; (at your op... | null | https://raw.githubusercontent.com/outergod/cl-m4/9f6518b5a173a1234ae39ef45758927d329ded4a/test/m4-composite.lisp | lisp | cl-m4 - m4-composite.lisp
cl-m4 is free software; you can redistribute it and/or modify
either version 3 of the License , or
(at your option) any later version.
cl-m4 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR ... | Copyright ( C ) 2010 < >
This file is part of cl - m4 .
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
(in-package :cl-m4-test)
(in-suite m4)
5 How to define new macros
TODO format
5.2 Arguments to macros
(de... |
cc805fb843dfd12b8ec790abc0ae2441c506f3ec1310bea16e14366c2b00a0de | racket/gui | gc-blits.rkt | #lang racket/base
(require racket/class
racket/gui/base)
(define w 50)
(define h 50)
(define on (make-bitmap w h))
(define off (make-bitmap w h))
(send (send on make-dc) draw-rectangle 5 5 (- w 10) (- h 10))
(send
(for/fold ([prev-f #f]) ([i (in-range 10)])
(define f (new frame% [label "GC Blit"] [width 100] [h... | null | https://raw.githubusercontent.com/racket/gui/d1fef7a43a482c0fdd5672be9a6e713f16d8be5c/gui-test/tests/gracket/gc-blits.rkt | racket | #lang racket/base
(require racket/class
racket/gui/base)
(define w 50)
(define h 50)
(define on (make-bitmap w h))
(define off (make-bitmap w h))
(send (send on make-dc) draw-rectangle 5 5 (- w 10) (- h 10))
(send
(for/fold ([prev-f #f]) ([i (in-range 10)])
(define f (new frame% [label "GC Blit"] [width 100] [h... | |
264754b7f82fd939225c883385f6e110fab9b1e0c37a351f7a4c76883fb5676f | keera-studios/haskell-game-programming | Constants.hs | module Constants where
import Data.Int
import Data.Word
import Graphics.UI.SDL as SDL
width :: Double
width = 640
height :: Double
height = 480
gameWidth :: Double
gameWidth = width
gameHeight :: Double
gameHeight = height
-- Energy transmission between objects in collisions
velTrans :: Double
velTrans = 1.00
... | null | https://raw.githubusercontent.com/keera-studios/haskell-game-programming/d4998decb4664a978c87199347f53b420d763b1e/tutorials/frp/yampa/tutorial004-collisions/src/Constants.hs | haskell | Energy transmission between objects in collisions
Delays
Colors | module Constants where
import Data.Int
import Data.Word
import Graphics.UI.SDL as SDL
width :: Double
width = 640
height :: Double
height = 480
gameWidth :: Double
gameWidth = width
gameHeight :: Double
gameHeight = height
velTrans :: Double
velTrans = 1.00
speed
maxVNorm :: Double
maxVNorm = 500
ballW... |
824302451db22a730fb3a4403e5bc1af3080a37a601b89b6aad76ae3ce8a9c6c | phadej/kleene-type | Debug.hs | module KleenePlugin.Debug where
import qualified Outputable as PP
import Debug.Trace
tracePpr :: PP.Outputable a => String -> a -> b -> b
tracePpr tag x = trace $ PP.showSDocUnsafe $ PP.hang (PP.text tag) 2 (PP.ppr x)
tracePprId :: PP.Outputable b => String -> b -> b
tracePprId tag x = tracePpr tag x x
| null | https://raw.githubusercontent.com/phadej/kleene-type/cb7332b98ae229e162c12186fd4d7fccb06ab62f/plugin/KleenePlugin/Debug.hs | haskell | module KleenePlugin.Debug where
import qualified Outputable as PP
import Debug.Trace
tracePpr :: PP.Outputable a => String -> a -> b -> b
tracePpr tag x = trace $ PP.showSDocUnsafe $ PP.hang (PP.text tag) 2 (PP.ppr x)
tracePprId :: PP.Outputable b => String -> b -> b
tracePprId tag x = tracePpr tag x x
| |
7e5a094d9f9f7e8992490f07a6ddbfd8831c12377bc57d9677e94f821ff03149 | thizanne/cormoran | typing.ml | open Batteries
module L = Location
module T = TypedAst
module U = UntypedAst
module Ty = Types
type ('var, 'spec) var_loc_typer =
(* We need higher order polymorphism in type_expression *)
{ f : 't. 't Ty.t -> 'var L.loc -> ('t, 'spec) T.var L.loc }
let type_program_var env expected_type loc var_sym =
let fo... | null | https://raw.githubusercontent.com/thizanne/cormoran/46d13330ebd1c8224a0603fd473d8e6bed48bf53/src/typing.ml | ocaml | We need higher order polymorphism in type_expression
FIXME: check the number of shared variables
Check that each tid is present at most once
Check that labels are correct
Yup, this is non-optimal. Who cares, it's fast anyway. | open Batteries
module L = Location
module T = TypedAst
module U = UntypedAst
module Ty = Types
type ('var, 'spec) var_loc_typer =
{ f : 't. 't Ty.t -> 'var L.loc -> ('t, 'spec) T.var L.loc }
let type_program_var env expected_type loc var_sym =
let found_type, found_origin = Env.get_entry loc var_sym env in
... |
c55dce1e15b79997c7546071c375b5d8482d168f880ed78a1c41c08b8b289c40 | twosigma/waiter | token_watch_integration_test.clj | (ns waiter.token-watch-integration-test
(:require [clojure.core.async :as async]
[clojure.set :as set]
[clojure.test :refer :all]
[waiter.status-codes :refer :all]
[waiter.util.client-tools :refer :all]))
(defn- await-goal-response-for-all-routers
"Returns true if th... | null | https://raw.githubusercontent.com/twosigma/waiter/7d985f4e5642e0e6efd26830b7b139db21a05251/waiter/integration/waiter/token_watch_integration_test.clj | clojure | (ns waiter.token-watch-integration-test
(:require [clojure.core.async :as async]
[clojure.set :as set]
[clojure.test :refer :all]
[waiter.status-codes :refer :all]
[waiter.util.client-tools :refer :all]))
(defn- await-goal-response-for-all-routers
"Returns true if th... | |
8a05730f70418957a235c00d18a7d04e2ba5035eb0d707c08da13fc356949150 | davidar/stochaskell | Main.hs | # LANGUAGE FlexibleContexts , MonadComprehensions , NoMonomorphismRestriction , RebindableSyntax #
module Main where
import Language.Stochaskell
import Language.Stochaskell.Plot
import System.Directory
prefix = "sgcp"
noise = 1e-3
kernelSE lsv lls2 a b =
exp (lsv - (a - b)^2 / (2 * exp lls2))
gpClassifier :: (R ... | null | https://raw.githubusercontent.com/davidar/stochaskell/d28f9245f5e07c004fb8fd3c828ac2e1cc561673/stochaskell/app/sgcp/Main.hs | haskell | birth
death | # LANGUAGE FlexibleContexts , MonadComprehensions , NoMonomorphismRestriction , RebindableSyntax #
module Main where
import Language.Stochaskell
import Language.Stochaskell.Plot
import System.Directory
prefix = "sgcp"
noise = 1e-3
kernelSE lsv lls2 a b =
exp (lsv - (a - b)^2 / (2 * exp lls2))
gpClassifier :: (R ... |
55a9f51bc5fa322b12af7a4ae55a532cad8297984429b170e3630c179c43d8d8 | screenshotbot/screenshotbot-oss | debugger-hook.lisp | (defpackage :util/debugger-hook
(:use #:cl)
(:local-nicknames (#:a #:alexandria))
(:export
#:log4cl-debugger-hook))
(in-package :util/debugger-hook)
(defun log4cl-debugger-hook (condition debugger-hook)
(declare (ignore debugger-hook))
(handler-case
(let ((output (with-output-to-string (out)
... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/82ef8d21ed46b8ba61bca6fcf8d79fc25d3e5e3d/src/util/debugger-hook.lisp | lisp | (defpackage :util/debugger-hook
(:use #:cl)
(:local-nicknames (#:a #:alexandria))
(:export
#:log4cl-debugger-hook))
(in-package :util/debugger-hook)
(defun log4cl-debugger-hook (condition debugger-hook)
(declare (ignore debugger-hook))
(handler-case
(let ((output (with-output-to-string (out)
... | |
896c526a09d25d0468c2353de9bc3ddd3a81fe96b13763c640b10abd4e3f5ead | mpickering/ghcide-reflex | LanguageServer.hs | Copyright ( c ) 2019 The DAML Authors . All rights reserved .
SPDX - License - Identifier : Apache-2.0
# LANGUAGE ExistentialQuantification #
# OPTIONS_GHC -w #
-- WARNING: A copy of DA.Daml.LanguageServer, try to keep them in sync
-- This version removes the daml: handling
module Development.IDE.LSP.LanguageSe... | null | https://raw.githubusercontent.com/mpickering/ghcide-reflex/67ddebf0c1d4728e850057b9bd7c6852c0d96350/src/Development/IDE/LSP/LanguageServer.hs | haskell | WARNING: A copy of DA.Daml.LanguageServer, try to keep them in sync
This version removes the daml: handling
import Data.Default
^ A complete set of handlers which trigger events
Move stdout to another file descriptor and duplicate stderr
to stdout. This guards against stray prints from corrupting the JSON-RPC
mes... | Copyright ( c ) 2019 The DAML Authors . All rights reserved .
SPDX - License - Identifier : Apache-2.0
# LANGUAGE ExistentialQuantification #
# OPTIONS_GHC -w #
module Development.IDE.LSP.LanguageServer
( runLanguageServer
) where
import Language.Haskell.LSP.Types
import Language.H... |
12b4e8a31ea96328f66fcf24a6fdce5acdd291e996f1e1eb25138291fd9dc9d5 | robert-strandh/SICL | conditions.lisp | (cl:in-package #:sicl-sequence)
(define-condition must-be-nonnegative-integer (type-error)
()
(:default-initargs :expected-type '(integer 0)))
(define-condition must-be-cons (type-error)
()
(:default-initargs :expected-type 'cons))
(define-condition must-be-sequence (type-error)
()
(:default-initargs :ex... | null | https://raw.githubusercontent.com/robert-strandh/SICL/73664616e4c9825e9664a084b398d268edd6b650/Code/Sequence/conditions.lisp | lisp | Index Handling
bounding indexes is invalid. This can be because it is not an
integer, or because it is less than 0 or greater than the length
of the sequence.
This condition is used by sequence functions when the END bounding
indexes is invalid. This can be because it is neither an integer
of the sequence.
Te... | (cl:in-package #:sicl-sequence)
(define-condition must-be-nonnegative-integer (type-error)
()
(:default-initargs :expected-type '(integer 0)))
(define-condition must-be-cons (type-error)
()
(:default-initargs :expected-type 'cons))
(define-condition must-be-sequence (type-error)
()
(:default-initargs :ex... |
c389b3667fd63f931f11c0f33a192e8d11c4319a9b000931a6fa34137e44be3f | nomeata/gipeda | ReportTypes.hs | # LANGUAGE DeriveGeneric , ViewPatterns , RecordWildCards , OverloadedStrings , CPP #
module ReportTypes where
import qualified Data.Map as M
import Data.Aeson
import Data.Aeson.Types
import GHC.Generics
import Text.Printf
import Data.List
import Data.Char
import Paths
import ReadResult
import qualified BenchmarkSet... | null | https://raw.githubusercontent.com/nomeata/gipeda/f3c8c52df24361c1a09bdfbdaefcd63b54fef0d8/src/ReportTypes.hs | haskell | , status :: Status
have that in the graph report, for the tallying for the graph summary. But all not very
satisfactory.)
Adjusted threshold, to make sure that the inverse change is flagged
equivalently
even if the user did not set the numberType correctly: | # LANGUAGE DeriveGeneric , ViewPatterns , RecordWildCards , OverloadedStrings , CPP #
module ReportTypes where
import qualified Data.Map as M
import Data.Aeson
import Data.Aeson.Types
import GHC.Generics
import Text.Printf
import Data.List
import Data.Char
import Paths
import ReadResult
import qualified BenchmarkSet... |
7169f36b54fe425fa948f8c50dbba889e57bba16055aaa8ac25f5b824914a18f | tonyvanriet/lunch-bot | handler_test.clj | (ns lunch-bot.command.handler-test
(:require [clojure.test :refer :all]
[lunch-bot.command.handler :refer :all]
[clj-time.core :as time]))
(deftest cost-out-yields-cost-retracted
(let [today (time/today)
person "U1234"
cost-amount 2.34M
out-cmd {:command-type :decla... | null | https://raw.githubusercontent.com/tonyvanriet/lunch-bot/14e9ab3eb3d6ab913e27df7967a470a594e1b5c3/test/lunch_bot/command/handler_test.clj | clojure | (ns lunch-bot.command.handler-test
(:require [clojure.test :refer :all]
[lunch-bot.command.handler :refer :all]
[clj-time.core :as time]))
(deftest cost-out-yields-cost-retracted
(let [today (time/today)
person "U1234"
cost-amount 2.34M
out-cmd {:command-type :decla... | |
1c6f1bfae4a764ba47d8eaf0db5addde0f7c0f24566e1417c12a444e44486f86 | willtim/Atavachron | Path.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE EmptyDataDecls #-}
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE KindSignatures #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ViewPatterns #
-- | An encoding-independent, type-safe and efficient file path.
--
The standard library FilePath ( a synonym fo... | null | https://raw.githubusercontent.com/willtim/Atavachron/bbf9a93eac0e096ee4595e23067c912af865601e/src/Atavachron/Path.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE EmptyDataDecls #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
| An encoding-independent, type-safe and efficient file path.
that it takes the bytes returned by a POSIX system call and assumes
a default encoding when no encoding information was given. The
internal represent... | # LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE ViewPatterns #
The standard library FilePath ( a synonym for String ) is flawed , in
module Atavachron.Path where
import qualified Data.ByteString as B
import qualified Data.ByteString.Short as SB
import qualified Data.ByteString.Char8 as B8
im... |
e5448446ae27174a84c7d80f1f4aae5e967fd9df1c1fa426b7d2fe63f321b90a | ioannad/jeffrey | packages.lisp | (defpackage jeffrey.graph
(:use :common-lisp)
(:export :*graph*
:make-node
:node-name
:node-edges
:node-parents
:node-LaTeX
:node-references
:add-edge
:add-parent
:make-edge
:edge-destination
:edge-relation
:edge-attributes)
(:documentation
"Here the graph relat... | null | https://raw.githubusercontent.com/ioannad/jeffrey/a87007cb9a50f17790bfca9ee5ac335da4587297/packages.lisp | lisp | export for testing only
export for testing only
export for testing only
export for testing only
export for testing only
export for testing only
export for testing only | (defpackage jeffrey.graph
(:use :common-lisp)
(:export :*graph*
:make-node
:node-name
:node-edges
:node-parents
:node-LaTeX
:node-references
:add-edge
:add-parent
:make-edge
:edge-destination
:edge-relation
:edge-attributes)
(:documentation
"Here the graph relat... |
d25db7b46d6e85ade79015ec17aae00f558d1c1f6d431f46afc579a60c25bf1a | threatgrid/asami | bufferblock.clj | (ns ^{:doc "Abstraction for blocks of raw data, keyed by ID. IDs represent the offset of the block."
:author "Paula Gearon"}
asami.durable.block.bufferblock
(:require [asami.durable.block.block-api :refer [Block put-block!]])
(:import [java.nio ByteBuffer IntBuffer LongBuffer]))
;; (set! *warn-on-reflectio... | null | https://raw.githubusercontent.com/threatgrid/asami/d3f1741ad368e25a3100eff280d38350b98cfe70/src/asami/durable/block/bufferblock.clj | clojure | (set! *warn-on-reflection* true)
An implementation of Block that can have multiple readers,
but only a single writing thread
a single writer allows for position/put
and are not available on the general Block API | (ns ^{:doc "Abstraction for blocks of raw data, keyed by ID. IDs represent the offset of the block."
:author "Paula Gearon"}
asami.durable.block.bufferblock
(:require [asami.durable.block.block-api :refer [Block put-block!]])
(:import [java.nio ByteBuffer IntBuffer LongBuffer]))
(defrecord BufferBlock
... |
97a0715ff514dcb4815e2effe35377639dc5946cb479cb9597e1fb077dfaf188 | mirage/cactus | vertex.mli |
* Copyright ( c ) 2021 Tarides < >
* Copyright ( c ) 2021 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SO... | null | https://raw.githubusercontent.com/mirage/cactus/3eb2a4abee79bf8f20de5b4b12a57c3421c3e2fe/src/vertex.mli | ocaml |
* Copyright ( c ) 2021 Tarides < >
* Copyright ( c ) 2021 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SO... | |
2ca40288c8a176096170919ee2ab1ec3c1d9c64d717c9821298527c627768488 | kmi/irs | see-processes.lisp | ;;
;; Ontology Capturing the SEE Processes
;; Serves as SEE formalisation of the internal execution processes
;; and supports monitoring them
;;
Author :
Creation Date : 10/7/2008
Last Change : 10/7/2008
;;
(in-package "OCML")
(in-ontology see-processes)
;; Ontology Classes
(def-class #_InvokeWebService ( #_... | null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/ontologies/domains/see-processes/see-processes.lisp | lisp |
Ontology Capturing the SEE Processes
Serves as SEE formalisation of the internal execution processes
and supports monitoring them
Ontology Classes | Author :
Creation Date : 10/7/2008
Last Change : 10/7/2008
(in-package "OCML")
(in-ontology see-processes)
(def-class #_InvokeWebService ( #_COBRA:Activity )
)
(def-class #_SelectWebService ( #_COBRA:Activity )
)
(def-class #_DiscoverWebServices ( #_COBRA:Activity )
)
(def-class #_AchieveGoal ( #_COBRA:Pr... |
5908ecc2dae29c339ad01fa7c6ed313f9b77e86f44cd67823e6af39dc9db747f | 8c6794b6/haskell-sc-scratch | Zipper1.hs | ------------------------------------------------------------------------------
-- |
-- Module : $Header$
CopyRight : ( c ) 8c6794b6
-- License : BSD3
Maintainer :
-- Stability : unstable
-- Portability : non-portable
--
-- From:
--
-- *
--
module Zipper.Zipper1 where
import Delimited.CCExc
import... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Scratch/Oleg/Zipper/Zipper1.hs | haskell | ----------------------------------------------------------------------------
|
Module : $Header$
License : BSD3
Stability : unstable
Portability : non-portable
From:
*
| CopyRight : ( c ) 8c6794b6
Maintainer :
module Zipper.Zipper1 where
import Delimited.CCExc
import Control.Monad.Identity
import Control.Monad.Trans
data Term = Var String
| A Term Term
| L String Term
deriving (Eq)
instance Show Term where
show term = showt 0 term
where ... |
7364923130a53a0f6ffa77b1b2221adfc12316c9fd083c5e1b4a8a12fade72f5 | donatello/minio-hs-archived | Prelude.hs |
Welcome to your custom Prelude
Export here everything that should always be in your library scope
For more info on what is exported by Protolude check :
Welcome to your custom Prelude
Export here everything that should always be in your library scope
For more info on what is exported by Protolude check:
-}
... | null | https://raw.githubusercontent.com/donatello/minio-hs-archived/c808dc1be2a5b15c2c714c0052f1d6a7bc98a809/src/Lib/Prelude.hs | haskell |
Welcome to your custom Prelude
Export here everything that should always be in your library scope
For more info on what is exported by Protolude check :
Welcome to your custom Prelude
Export here everything that should always be in your library scope
For more info on what is exported by Protolude check:
-}
... | |
f23ce482040dc3dc4e94a89ee317ed3f102199b7f5503176ddb42ed2a3ed797a | TikhonJelvis/Cow | ParseTree.hs | {-# LANGUAGE RankNTypes #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE DeriveFunctor #-}
# LANGUAGE LambdaCase #
# LANGUAGE MonadComprehensions #
module Cow.ParseTree where
import Control.Monad.State (evalState, get, modify)
impor... | null | https://raw.githubusercontent.com/TikhonJelvis/Cow/65832f9826ede4c1380cdc35a42f2b85b1bfebea/src/Cow/ParseTree.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE DeriveFunctor #
| A parse tree that carries the parsed tokens in its leaves, along
with arbitrary annotations at each node.
| A parse tree where we don't care about the annotations at each
node, only the leaves.
TODO: This is probably woefully inefficient!
| A lens which a... | # LANGUAGE PatternSynonyms #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE LambdaCase #
# LANGUAGE MonadComprehensions #
module Cow.ParseTree where
import Control.Monad.State (evalState, get, modify)
import Data.Array (Array)
import qualified Data.Arr... |
802109e05b2ce8dc91c38e1555cd516cbb155552db1e22f71ffa09d5f399b2f3 | inaka/rpsls | rpsls_randy_player.erl | @author < >
@doc is another random player .
%%
%% Explanation:
Similar to RPS game , RPSLS is a balanced game , i.e. win chances distribute uniformely over all the choices .
%% So it is impossible to gain an advantage over a truly random opponent.
This can be easily seen by looking into the RPSLS normal... | null | https://raw.githubusercontent.com/inaka/rpsls/85f6621cfa55a803edf9c2a9fd43901415b9ba80/src/players/rpsls_randy_player.erl | erlang |
Explanation:
So it is impossible to gain an advantage over a truly random opponent.
(build from the normal form matrix)
| @author < >
@doc is another random player .
Similar to RPS game , RPSLS is a balanced game , i.e. win chances distribute uniformely over all the choices .
This can be easily seen by looking into the RPSLS normal form matrix ( ) , which is one of magic square
matrices that sums to 0 in any column / row ... |
d910cf85962f179e299e5e3a31b86869a88cdffb5c753bcec36656f4a964cf98 | ninenines/ranch | tcp_echo_app.erl | %% Feel free to use, reuse and abuse the code in this file.
@private
-module(tcp_echo_app).
-behaviour(application).
%% API.
-export([start/2]).
-export([stop/1]).
%% API.
start(_Type, _Args) ->
{ok, _} = ranch:start_listener(tcp_echo,
ranch_tcp, #{socket_opts => [{port, 5555}]},
echo_protocol, []),
tcp_ech... | null | https://raw.githubusercontent.com/ninenines/ranch/4a1d16242c6fa9865fd7499d301d90b9ca65d6b1/examples/tcp_echo/src/tcp_echo_app.erl | erlang | Feel free to use, reuse and abuse the code in this file.
API.
API. |
@private
-module(tcp_echo_app).
-behaviour(application).
-export([start/2]).
-export([stop/1]).
start(_Type, _Args) ->
{ok, _} = ranch:start_listener(tcp_echo,
ranch_tcp, #{socket_opts => [{port, 5555}]},
echo_protocol, []),
tcp_echo_sup:start_link().
stop(_State) ->
ok.
|
72089b5362ea1d4d656dc79189ad9727f10f12a9abdd4564d37ebca524232889 | rohitjha/DiMPL | Primes.hs | |
Module : Primes
Description : Prime Numbers module for the DiMPL DSL
Copyright : ( c ) , 2016
License : BSD2
Maintainer :
Stability : Stable
Functionality for :
* Generating prime numbers upto a limit ( Sieve of Eratosthenes )
* Generate first ' n ' primes
* Gene... | null | https://raw.githubusercontent.com/rohitjha/DiMPL/087c499ba104dec897fe325f86580e6d623c86ee/src/Primes.hs | haskell | internal functions ----------------------
--------------------------------------------
internal function for trial division
The 'isTrialDivisionPrime' function is checks the primality of a number using trial division.
For example:
>>> isTrialDivisionPrime 83498594
False
>>> isTrialDivision... | |
Module : Primes
Description : Prime Numbers module for the DiMPL DSL
Copyright : ( c ) , 2016
License : BSD2
Maintainer :
Stability : Stable
Functionality for :
* Generating prime numbers upto a limit ( Sieve of Eratosthenes )
* Generate first ' n ' primes
* Gene... |
ddc2e8faa76ba96bda622a9c43ce808226ab3303f2542ca5f5392df012db0c93 | byorgey/haskell-course | InClass.hs |
pair :: Applicative f => f a -> f b -> f (a,b)
pair fa fb = (\x y -> (x,y)) <$> fa <*> fb
-- = (,) <$> fa <*> fb
-- = liftA2 (,) fa fb
-- pair = liftA2 (,)
(*>) :: Applicative f => f a -> f b -> f b
mapA :: Applicative f => (a -> f b) -> [a] -> f [b]
sequenceA :: Applicative f => [f a] -> f [a]
... | null | https://raw.githubusercontent.com/byorgey/haskell-course/f928cc8031aec2147f037949826134a484414ed6/weeks/11-applicative2/InClass.hs | haskell | = (,) <$> fa <*> fb
= liftA2 (,) fa fb
pair = liftA2 (,) |
pair :: Applicative f => f a -> f b -> f (a,b)
pair fa fb = (\x y -> (x,y)) <$> fa <*> fb
(*>) :: Applicative f => f a -> f b -> f b
mapA :: Applicative f => (a -> f b) -> [a] -> f [b]
sequenceA :: Applicative f => [f a] -> f [a]
replicateA :: Applicative f => Int -> f a -> f [a]
|
9f1aa72a47276e8f6adf710c1d7d3876c49cda7dd4d849953215f4f4cf5f49bc | pavlobaron/ErlangOTPBookSamples | sum3.erl | -module(sum3).
-export([sum/2]).
sum(0, 0) ->
"unberechenbar";
sum(X, Y) ->
Z = X + Y,
Z + 100.
| null | https://raw.githubusercontent.com/pavlobaron/ErlangOTPBookSamples/50094964ad814932760174914490e49618b2b8c2/sprache/sum3.erl | erlang | -module(sum3).
-export([sum/2]).
sum(0, 0) ->
"unberechenbar";
sum(X, Y) ->
Z = X + Y,
Z + 100.
| |
98bcab1ce31314866822ca3a1933fe0b3b34f841df6cddf25160a58a345c54d3 | maralorn/kassandra | TimeWidgets.hs | module Kassandra.TimeWidgets (
dateSelectionWidget,
) where
import Kassandra.BaseWidgets (
button,
icon,
stateWidget,
)
import Kassandra.TextEditWidget (editText)
import Kassandra.Types (
StandardWidget,
Widget,
getTime,
)
import qualified Reflex as R
import qualified Reflex.Dom as D
myFormatTime :: Z... | null | https://raw.githubusercontent.com/maralorn/kassandra/598133b89ab4e4a6209da920636e9e6ee540f38a/apps/kassandra/kassandra/src/Kassandra/TimeWidgets.hs | haskell | module Kassandra.TimeWidgets (
dateSelectionWidget,
) where
import Kassandra.BaseWidgets (
button,
icon,
stateWidget,
)
import Kassandra.TextEditWidget (editText)
import Kassandra.Types (
StandardWidget,
Widget,
getTime,
)
import qualified Reflex as R
import qualified Reflex.Dom as D
myFormatTime :: Z... | |
e07cb653df391bd6030088a5e811f4c7b8b073643b95b4c4aa73c16d64d0a96a | may-liu/qtalk | mod_muc_log.erl | %%%----------------------------------------------------------------------
%%% File : mod_muc_log.erl
%%% Author :
%%% Purpose : MUC room logging
Created : 12 Mar 2006 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2014 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
m... | null | https://raw.githubusercontent.com/may-liu/qtalk/f5431e5a7123975e9656e7ab239e674ce33713cd/qtalk_opensource/src/mod_muc_log.erl | erlang | ----------------------------------------------------------------------
File : mod_muc_log.erl
Author :
Purpose : MUC room logging
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
... | Created : 12 Mar 2006 by < >
ejabberd , Copyright ( C ) 2002 - 2014 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
with this program ; ... |
10f58d5176b7f088b06b75fd95c02cd7831dc648a8cf04377c4b295c8d8d66d3 | target/theta-idl | QuasiQuoter.hs | {-# LANGUAGE DerivingStrategies #-}
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TypeApplications #
| A quasiquoter that generates ' ' values . This makes it easy
for us to generate code dynamically .... | null | https://raw.githubusercontent.com/target/theta-idl/53f360373ece11c6953d99697a96f2b9ca8f2fa8/theta/src/Theta/Target/Rust/QuasiQuoter.hs | haskell | # LANGUAGE DerivingStrategies #
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell #
@
-- generate a simple Rust struct with the given name:
struct :: Rust -> Rust
struct name = [rust|
#[derive(Debug)]
struct $name {
}
|]
@
Right now, this just does string interpol... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TypeApplications #
| A quasiquoter that generates ' ' values . This makes it easy
for us to generate code dynamically .
field : i32 ,
struct {
field : i32 ,
This produces the following snippet :
struct {
field : i32 ,
... |
26432d023a196adcc42f43ebc6aa403238f813ff789220700d7f1d8bf13e6b0f | greghendershott/blog | make-sitemap.rkt | #lang racket/base
Copyright 2019 by .
;;
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
dis... | null | https://raw.githubusercontent.com/greghendershott/blog/f487bda88e4cccad3585623a7e772ffc34f5d73e/rkt/make-sitemap.rkt | racket |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permis... | #lang racket/base
Copyright 2019 by .
distributed under the License is distributed on an " AS IS " BASIS ,
(require racket/require
(multi-in racket (contract file format match path string))
"site.rkt"
"tag-posts.rkt"
"util.rkt")
(module+ main (main))
(define (main)
(match... |
cf2079011a73603349aaae4672da7a314df083bfcbbe6005ccb88e074dff2f31 | metosin/ring-swagger | project.clj | (defproject metosin/ring-swagger "0.26.2"
:description "Swagger Spec for Ring Apps"
:url "-swagger"
:license {:name "Eclipse Public License"
:url "-v10.html"
:distribution :repo
:comments "same as Clojure"}
:dependencies [[cheshire "5.8.1"]
[metosin/ring-http... | null | https://raw.githubusercontent.com/metosin/ring-swagger/0ef9046174dec0ebd4cbf97d6cc5c6846ef11996/project.clj | clojure | (defproject metosin/ring-swagger "0.26.2"
:description "Swagger Spec for Ring Apps"
:url "-swagger"
:license {:name "Eclipse Public License"
:url "-v10.html"
:distribution :repo
:comments "same as Clojure"}
:dependencies [[cheshire "5.8.1"]
[metosin/ring-http... | |
e02d4d9b8b08b49e06462157d865b7ae218d44227cf79e46dc2f94b7fa273938 | justinmeiners/exercises | friend.scm | (load "ring-matrix.scm")
; or and and are not functions, but compiler expanded
; so we need to wrap
(define (logical-or a b) (if (or (= a 1) (= b 1)) 1 0))
(define (logical-and a b) (if (and (= a 1) (= b 1)) 1 0))
(define adjacency-ring (ring-create logical-or 0 logical-and 1))
(define people '(DEREK JUSTIN JAMES GR... | null | https://raw.githubusercontent.com/justinmeiners/exercises/9491bc16925eae12e048ccd3f424b870ebdc73aa/semiring-paths/friend.scm | scheme | or and and are not functions, but compiler expanded
so we need to wrap | (load "ring-matrix.scm")
(define (logical-or a b) (if (or (= a 1) (= b 1)) 1 0))
(define (logical-and a b) (if (and (= a 1) (= b 1)) 1 0))
(define adjacency-ring (ring-create logical-or 0 logical-and 1))
(define people '(DEREK JUSTIN JAMES GREG DON))
(define relation (matrix-create (length people) 0))
(define (make... |
fdb1746beaf806b100123c4a41e5119689e6512533cce4ea71383efd4b9d24af | McParen/croatoan | insstr.lisp | (in-package :de.anvi.croatoan)
(defun insert-string (window string &key attributes fgcolor bgcolor color-pair style y x position n)
"Insert string before the current position in window.
Chars right of the cursor are moved to the right. The rightmost chars
on the line may be lost. The cursor position is not changed.... | null | https://raw.githubusercontent.com/McParen/croatoan/413e8855b78a2e408f90efc38e8485f880691684/src/insstr.lisp | lisp | we cant use length to determine the length of a complex string
because it is not a sequence.
(if (or attributes fgcolor bgcolor color-pair style)
lisp string combined with attributes and colors
simple lisp string, no attributes or colors
(if n | (in-package :de.anvi.croatoan)
(defun insert-string (window string &key attributes fgcolor bgcolor color-pair style y x position n)
"Insert string before the current position in window.
Chars right of the cursor are moved to the right. The rightmost chars
on the line may be lost. The cursor position is not changed.... |
191dec55816d36779ed120cbfcd6e9da3c4347b2302813dcf4b7c9357dec835a | rabbibotton/clos-encounters | clos-encounters.lisp | (defpackage :clos-encounters ; Create our package
(:use :common-lisp :clog) ; Use :common-lisp and :clog
(:export start-game)) ; Export from package our initialization
; function by exporting it's symbol.
CL is not about files , but logical partitions
... | null | https://raw.githubusercontent.com/rabbibotton/clos-encounters/860ef5aee3043187da36414c3029746ec6df9080/clos-encounters.lisp | lisp | Create our package
Use :common-lisp and :clog
Export from package our initialization
function by exporting it's symbol.
called packages with internal and exported
symbols.
Once you have loaded clos-enounters with:
(ql:quickload :clos-encounters)
in the REPL, the clos-encounters system is loaded and
compil... | CL is not about files , but logical partitions
( meta / alt - comma ) CLOG is very well documented both
TITLE - SCREEN has one parameter , the name of the parameter does not matter .
We know to use one parameter because the documentation for CLOG framework
and call the default route which we established in... |
3ddc9dcadb02225762f55ce24fba4e199737b74d30e3c01442ffa0f67d15174c | mirage/bechamel | oLS.ml | open Bechamel
type t = { estimate : float; r_square : float option; ci95 : ci95 option }
and ci95 = { r : float; l : float }
let ci95_witness : ci95 Json_encoding.encoding =
let open Json_encoding in
let l = req "low" float in
let r = req "high" float in
conv (fun t -> (t.l, t.r)) (fun (l, r) -> { l; r }) (ob... | null | https://raw.githubusercontent.com/mirage/bechamel/8e1a3e64c6723d1d9b2081aeb06d725024f88012/lib/js/oLS.ml | ocaml | open Bechamel
type t = { estimate : float; r_square : float option; ci95 : ci95 option }
and ci95 = { r : float; l : float }
let ci95_witness : ci95 Json_encoding.encoding =
let open Json_encoding in
let l = req "low" float in
let r = req "high" float in
conv (fun t -> (t.l, t.r)) (fun (l, r) -> { l; r }) (ob... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.