_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 |
|---|---|---|---|---|---|---|---|---|
376c62bba8a9dda10f2109809ec05c9cc63ee791144ab6ff67055a30069392b1 | links-lang/links | var.mli | (** {0 IR variables} *)
module Scope: sig
type t = Local | Global
[@@deriving show]
val is_global : t -> bool
val is_local : t -> bool
end
(** Term variables *)
type var = int
[@@deriving show,eq,yojson]
type var_info
[@@deriving show]
type binder
[@@deriving show]
val dummy_var : int
(** Generate ju... | null | https://raw.githubusercontent.com/links-lang/links/2923893c80677b67cacc6747a25b5bcd65c4c2b6/core/var.mli | ocaml | * {0 IR variables}
* Term variables
* Generate just a fresh identifier
* Given metadata, generate a full binder
* {0 Manipulate binder metadata}
* Create a copy of a type environment mapping vars (= ints) to types
instead of strings to types
|
module Scope: sig
type t = Local | Global
[@@deriving show]
val is_global : t -> bool
val is_local : t -> bool
end
type var = int
[@@deriving show,eq,yojson]
type var_info
[@@deriving show]
type binder
[@@deriving show]
val dummy_var : int
val fresh_raw_var : unit -> var
val fresh_binder : var_info ... |
b1b4922a69b57f7c617b9924a1f9c53e7c6da35d5f91d8d9f5d66e48dc44e7ef | jarohen/simple-brepl | project.clj | (defproject jarohen/simple-brepl (.trim (slurp (clojure.java.io/file "../resources/simple_brepl/VERSION")))
:description "A plugin to make opening a CLJS browser REPL simple, based atop Weasel"
:url "-henderson/simple-brepl"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [... | null | https://raw.githubusercontent.com/jarohen/simple-brepl/01169c5f650e768f8f65df238d452afa099537f7/simple-brepl/project.clj | clojure | (defproject jarohen/simple-brepl (.trim (slurp (clojure.java.io/file "../resources/simple_brepl/VERSION")))
:description "A plugin to make opening a CLJS browser REPL simple, based atop Weasel"
:url "-henderson/simple-brepl"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [... | |
b93ce65d3cfcb2a8d8db3d36fd26b08b66d3d51d9d29cc71cc29ed5585413824 | stacksmith/captive-neovim | toy.lisp | (in-package :cn)
( connect ( make - instance ' vimtoy ) 32 10 )
(defclass vimtoy (nvim)
;; keep track of cursor from cursor_goto
((w :accessor w :initform 0 )
(h :accessor h :initform 0 )
(x :accessor x :initform 0 )
(y :accessor y :initform 0 )
(cells :accessor cel... | null | https://raw.githubusercontent.com/stacksmith/captive-neovim/434834809958217cfdfb836892866639ae65fa48/toy.lisp | lisp | keep track of cursor from cursor_goto | (in-package :cn)
( connect ( make - instance ' vimtoy ) 32 10 )
(defclass vimtoy (nvim)
((w :accessor w :initform 0 )
(h :accessor h :initform 0 )
(x :accessor x :initform 0 )
(y :accessor y :initform 0 )
(cells :accessor cells :initform nil)
(dirty :accessor dirty :... |
65960cd8318c4892002975ac615a0316e1d5c39adeb0e44c5f94fd3914e16cc3 | dolphin-emu/codesearch-ui | util.cljs | Copyright 2014 Google Inc. All rights reserved .
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to in writing, softw... | null | https://raw.githubusercontent.com/dolphin-emu/codesearch-ui/abbe9fad5d40b740bd63f7711e02c2f666f50991/client/src-cljs/ui/util.cljs | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permi... | Copyright 2014 Google Inc. All rights reserved .
distributed under the License is distributed on an " AS IS " BASIS ,
(ns ui.util
(:require-macros [cljs.core.async.macros :refer [go-loop]])
(:require [cljs.core.async :refer [<!]])
(:import [goog Uri]))
(defn fix-encoding
"Tries to fix the encoding of strin... |
5267e3a5107338ad0c353c93456c55e3e5c91038340b4b3f9f39d69b7d6ae393 | alex-hhh/ActivityLog2 | notification-banner.rkt | #lang racket/base
;; This file is part of ActivityLog2, an fitness activity tracker
Copyright ( C ) 2018 , 2019 , 2020 < >
;;
;; This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation , either versio... | null | https://raw.githubusercontent.com/alex-hhh/ActivityLog2/36a4bb8af45db19cea02e982e22379acb18d0c49/rkt/widgets/notification-banner.rkt | racket | This file is part of ActivityLog2, an fitness activity tracker
This program is free software: you can redistribute it and/or modify it
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR P... | #lang racket/base
Copyright ( C ) 2018 , 2019 , 2020 < >
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 option )
(require racket/class
racket/gui/base
racket/math
"../utilities.rkt")
... |
5ac2f972989bef43c024084e60ad6a73d8c56076d738ece8b8ebe68ae646b18b | input-output-hk/cardano-base | VRF.hs | # LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
module Bench.Crypto.VRF
( benchmarks
) where
import Data.Proxy
import Data.ByteString (ByteString)
import Control.DeepSeq
import Cardano.Crypto.VRF.Class
import Cardano.Crypto.VRF.Simple
import ... | null | https://raw.githubusercontent.com/input-output-hk/cardano-base/eee4b00005284582faa79ad8a49b98d12aded6f6/cardano-crypto-tests/src/Bench/Crypto/VRF.hs | haskell | # LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
module Bench.Crypto.VRF
( benchmarks
) where
import Data.Proxy
import Data.ByteString (ByteString)
import Control.DeepSeq
import Cardano.Crypto.VRF.Class
import Cardano.Crypto.VRF.Simple
import ... | |
399683ce64910054788af100675f5060e9dc400aa87ab8e4acf4979126c51c74 | nikita-volkov/graph-db | CompetitionBench.hs |
import Benchmarks.Prelude hiding (group)
import CriterionPlus
import qualified Benchmarks.GraphDB as Gra
import qualified Benchmarks.Random as Ran
import qualified Benchmarks.Postgres as Pos
import qualified Benchmarks.Model as Mod
import qualified Benchmarks.AcidState as Aci
main = do
gen <- Ran.newGen
benchmar... | null | https://raw.githubusercontent.com/nikita-volkov/graph-db/3e886f6b298d2b2b09eb94c2818a7b648f42cb0a/executables/CompetitionBench.hs | haskell |
import Benchmarks.Prelude hiding (group)
import CriterionPlus
import qualified Benchmarks.GraphDB as Gra
import qualified Benchmarks.Random as Ran
import qualified Benchmarks.Postgres as Pos
import qualified Benchmarks.Model as Mod
import qualified Benchmarks.AcidState as Aci
main = do
gen <- Ran.newGen
benchmar... | |
c0ef043c7d84d2b546e50cfb7786643ce92b3f020a4eb794406ddbd4a0930d97 | Martoon-00/toy-compiler | Lib.hs | -- | Simple library linkage capabilities for functions written on language
( not ones defined in ) .
module Toy.Lang.Lib where
import Universum
import Toy.Base.Fun (FunSign (..))
import Toy.Exp (Exp (..), (<:))
import Toy.Lang.Data (FunDecls, Program (..), Stmt (..),... | null | https://raw.githubusercontent.com/Martoon-00/toy-compiler/a325d56c367bbb673608d283197fcd51cf5960fa/src/Toy/Lang/Lib.hs | haskell | | Simple library linkage capabilities for functions written on language
* Library | ( not ones defined in ) .
module Toy.Lang.Lib where
import Universum
import Toy.Base.Fun (FunSign (..))
import Toy.Exp (Exp (..), (<:))
import Toy.Lang.Data (FunDecls, Program (..), Stmt (..), forS, funCallS, ifS,
mkFunDecls)
import ... |
3338f435ee1a41e0930696bd315f369ba619f3b1ef450f0608e991417cb73216 | plclub/lngen | CoqLNOutputThmOpenClose2.hs | # LANGUAGE FlexibleContexts #
{-# OPTIONS_GHC -freduction-depth=50 #-}
module CoqLNOutputThmOpenClose2 where
import Text.Printf ( printf )
import AST
import ASTAnalysis
import ComputationMonad
import CoqLNOutputCommon
import CoqLNOutputCombinators
openCloseThms2 :: ASTAnalysis -> [[NtRoot]] -> M String
openCloseThm... | null | https://raw.githubusercontent.com/plclub/lngen/2c4f591f0c0fe6cb901e117a31d5d113735f8f54/src/CoqLNOutputThmOpenClose2.hs | haskell | # OPTIONS_GHC -freduction-depth=50 #
| @open u e = e@ when @lc e@.
ORDER TO OPEN | # LANGUAGE FlexibleContexts #
module CoqLNOutputThmOpenClose2 where
import Text.Printf ( printf )
import AST
import ASTAnalysis
import ComputationMonad
import CoqLNOutputCommon
import CoqLNOutputCombinators
openCloseThms2 :: ASTAnalysis -> [[NtRoot]] -> M String
openCloseThms2 aa nts =
do { close_degree_recs <-... |
659be8c4c82c69e43a1a79209e1e212ba062ad04b1667c61bf1e3c0994edca89 | eglaysher/rldev | convert.ml |
RlXml : general conversion logic
Copyright ( C ) 2006 Haeleth
This program is free software ; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation ; either version 2 of the License , or ( at your option ) any la... | null | https://raw.githubusercontent.com/eglaysher/rldev/e59103b165e1c20bd940942405b2eee767933c96/src/rlxml/convert.ml | ocaml |
RlXml : general conversion logic
Copyright ( C ) 2006 Haeleth
This program is free software ; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation ; either version 2 of the License , or ( at your option ) any la... | |
a3d7b71c9b9ece53e7ba428cd564e073195ce45d7c67e4d2aa91b59062886b08 | facebookarchive/pfff | meta_ast_php.mli | s : meta_ast_php.mli
val vof_program: Ast_php.program -> Ocaml.v
val vof_toplevel: Ast_php.toplevel -> Ocaml.v
val vof_expr: Ast_php.expr -> Ocaml.v
val vof_any: Ast_php.any -> Ocaml.v
(* used by pil.ml or ast_php_simple.ml *)
val vof_info: Ast_php.tok -> Ocaml.v
val vof_tok: Ast_php.tok -> Ocaml.v
val vof_dname: As... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_php/parsing/meta_ast_php.mli | ocaml | used by pil.ml or ast_php_simple.ml
e: meta_ast_php.mli | s : meta_ast_php.mli
val vof_program: Ast_php.program -> Ocaml.v
val vof_toplevel: Ast_php.toplevel -> Ocaml.v
val vof_expr: Ast_php.expr -> Ocaml.v
val vof_any: Ast_php.any -> Ocaml.v
val vof_info: Ast_php.tok -> Ocaml.v
val vof_tok: Ast_php.tok -> Ocaml.v
val vof_dname: Ast_php.dname -> Ocaml.v
val vof_name: Ast_p... |
91b46681dda076b8f04475e467b80ec2902c30323d765189afe268c9a1fe2532 | mfp/ocsiblog | hello.ml | Copyright ( C ) 2009 < >
open Eliom_parameters
open Lwt
let service = lazy begin
Eliom_predefmod.Text.register_new_service
~path:[""]
~get_params:unit
(fun sp () () -> return ("Hello, world\n", "text/plain"))
end
let () =
Eliom_services.register_eliom_module "hello"
(fun () -> ignore (Lazy.fo... | null | https://raw.githubusercontent.com/mfp/ocsiblog/e5048a971f3e4289855214418338ac032f11ea4c/hello.ml | ocaml | Copyright ( C ) 2009 < >
open Eliom_parameters
open Lwt
let service = lazy begin
Eliom_predefmod.Text.register_new_service
~path:[""]
~get_params:unit
(fun sp () () -> return ("Hello, world\n", "text/plain"))
end
let () =
Eliom_services.register_eliom_module "hello"
(fun () -> ignore (Lazy.fo... | |
d8e19113c16f135b8259ad2ae4b722a9a3186afd77c5436d30a30dfbcaa2a919 | mfine/postgresql-schema | Add.hs | -- |
-- Module: Add
Copyright : ( c ) 2015
License : MIT
Maintainer : < >
-- Stability: experimental
-- Portability: portable
--
-- Tool for adding PostgreSQL migrations.
import BasicPrelude hiding (FilePath)
import Data.Text (pack)
import Data.Time.Clock
impo... | null | https://raw.githubusercontent.com/mfine/postgresql-schema/5d495382c4e5d97de8103fc8e978503a64ce84b2/main/Add.hs | haskell | |
Module: Add
Stability: experimental
Portability: portable
Tool for adding PostgreSQL migrations. | Copyright : ( c ) 2015
License : MIT
Maintainer : < >
import BasicPrelude hiding (FilePath)
import Data.Text (pack)
import Data.Time.Clock
import Data.Time.Format
import Database.PostgreSQL.Schema
import Options.Applicative
import Shelly
data Args = Args
{ aFile :... |
7e7699516fee6a370c7a4fa7be2106745f203a4989e46a6fae464df28c430a46 | azimut/shiny | aubio.lisp | (in-package :shiny)
;; ## Using with incudine
Most straightforward usage I can think of is having aubio read an incudine buffer . Just have aubio and incudine use the same type for samples . And do something like :
;; ```
;; (defun test-onset (source-buffer)
" returns a list of the seconds where a set is found ... | null | https://raw.githubusercontent.com/azimut/shiny/774381a9bde21c4ec7e7092c7516dd13a5a50780/lib/aubio.lisp | lisp | ## Using with incudine
```
(defun test-onset (source-buffer)
(declare (incudine:buffer source-buffer))
(let* ((buffer-frames (buffer-frames source-buffer))
(sample-rate (round (buffer-sample-rate source-buffer)))
:collect slice))
(sets '())
(frames '())
... | (in-package :shiny)
Most straightforward usage I can think of is having aubio read an incudine buffer . Just have aubio and incudine use the same type for samples . And do something like :
" returns a list of the seconds where a set is found "
( slices ( loop : for slice : from 0 : by 512 : to buffer... |
60b68d70a5efa603392886ce0597b8df9451ca819868f5f38d281144433acc58 | basho/basho_bench | basho_bench_keygen.erl | %% -------------------------------------------------------------------
%%
%% basho_bench: Benchmarking Suite
%%
Copyright ( c ) 2009 - 2010 Basho Techonologies
%%
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... | null | https://raw.githubusercontent.com/basho/basho_bench/aa66398bb6a91645dbb97e91a236f3cdcd1f188f/src/basho_bench_keygen.erl | erlang | -------------------------------------------------------------------
basho_bench: Benchmarking Suite
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
spe... | Copyright ( c ) 2009 - 2010 Basho Techonologies
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(basho_bench_keygen).
-... |
2be6ab9b5687a621a5a9b9a62737cdd9fd2ccc904e870e601653791edd8f4ba4 | LPCIC/matita | oMeta2nMeta.ml | let convert_metasenv uri =
let new_metasenv, fixpoints =
List.fold_left
(fun (nm,fty) (i, ctx, ty) ->
let new_ty, fix_ty = OCic2NCic.convert_term uri ty in
in
assert (fixpoints = []);
new_metasenv
;;
| null | https://raw.githubusercontent.com/LPCIC/matita/794ed25e6e608b2136ce7fa2963bca4115c7e175/matita/components/ng_refiner/oMeta2nMeta.ml | ocaml | let convert_metasenv uri =
let new_metasenv, fixpoints =
List.fold_left
(fun (nm,fty) (i, ctx, ty) ->
let new_ty, fix_ty = OCic2NCic.convert_term uri ty in
in
assert (fixpoints = []);
new_metasenv
;;
| |
0cd8498b080ea3d5c48618347e0fd4543e3c0d47d86213433c3bb8ff0f990f43 | janestreet/core | bigsubstring.mli | (** Substring type based on [Bigarray], for use in I/O and C-bindings *)
open! Import
* @inline
| null | https://raw.githubusercontent.com/janestreet/core/b0be1daa71b662bd38ef2bb406f7b3e70d63d05f/core/src/bigsubstring.mli | ocaml | * Substring type based on [Bigarray], for use in I/O and C-bindings |
open! Import
* @inline
|
bd335476bd662d2784810ed02dd43d160eaa50e0160a3f620c02077b09a7b70d | stchang/mlish | main.rkt | #lang racket/base
(require (except-in "mlish.rkt" provide))
(require (only-in "mlish.rkt" [provide mlish:provide]))
(provide (all-from-out "mlish.rkt"))
(provide (rename-out [mlish:provide provide]))
| null | https://raw.githubusercontent.com/stchang/mlish/1c79d71b686fc734b7994eb9d412f84d518a64b1/mlish-lib/mlish/main.rkt | racket | #lang racket/base
(require (except-in "mlish.rkt" provide))
(require (only-in "mlish.rkt" [provide mlish:provide]))
(provide (all-from-out "mlish.rkt"))
(provide (rename-out [mlish:provide provide]))
| |
880670dc50b4ce7a992398cde2602784c8742d03c811af6886756dda240439ef | realworldocaml/book | ocaml_version.ml | Copyright ( c ) 2017 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/ocaml-version/ocaml_version.ml | ocaml | reversed order None > Some _
can be earlier, but no demand
can be earlier, but no demand for earlier versions
Frame pointers aren't currently supported on trunk
@ arch_opts
+no-flat-float-array for OCaml 4.12+
+afl for OCaml 4.05+
multicore fork packages are at the lowest patch version | Copyright ( c ) 2017 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS... |
cfa7302e78ea48d5f40dee34f262394832846ed61fd9950676e6d376f0d34f46 | SchornacklabSLCU/amfinder | imgPredictions.ml | AMFinder - img / imgPredictions.ml
*
* MIT License
* Copyright ( c ) 2021
*
* Permission is hereby granted , free of charge , to any person obtaining a copy
* of this software and associated documentation files ( the " Software " ) , to
* deal in the Software without restriction , including wit... | null | https://raw.githubusercontent.com/SchornacklabSLCU/amfinder/1053045b431b9e9e85a7bcebea2e38cda92a8dcd/amfbrowser/sources/img/imgPredictions.ml | ocaml | Populate with values.
TODO: improve this!
Sort valyes by their standard deviation.
TODO: Find a better solution to this! | AMFinder - img / imgPredictions.ml
*
* MIT License
* Copyright ( c ) 2021
*
* Permission is hereby granted , free of charge , to any person obtaining a copy
* of this software and associated documentation files ( the " Software " ) , to
* deal in the Software without restriction , including wit... |
427271c593fa99f26812ab6fe0f5f457b4300ce66f2a3f0628e7ee661507cd82 | c-cube/ocaml-containers | t_appendix_a.ml | let verbose = try Sys.getenv "VERBOSE" = "1" with _ -> false
[@@@ifge 4.08]
module J = Yojson.Safe
module Fmt = CCFormat
module Cbor = Containers_cbor
type json = Yojson.Safe.t
let pp_json = J.pretty_print ~std:true
let spf = Printf.sprintf
module Test = struct
type expect = Diagnostic of string | Decoded of jso... | null | https://raw.githubusercontent.com/c-cube/ocaml-containers/249dc3596e7ab5d03c0cc86b67840af2d477f181/src/cbor/tests/t_appendix_a.ml | ocaml | a few tests we need to skip
do we skip the rest of the test?
adjust display
skip bigint test | let verbose = try Sys.getenv "VERBOSE" = "1" with _ -> false
[@@@ifge 4.08]
module J = Yojson.Safe
module Fmt = CCFormat
module Cbor = Containers_cbor
type json = Yojson.Safe.t
let pp_json = J.pretty_print ~std:true
let spf = Printf.sprintf
module Test = struct
type expect = Diagnostic of string | Decoded of jso... |
a03e9c7e84d51e2517e54763fe34d207182b91894445c99ac9c6a449a510bf92 | spurious/chibi-scheme-mirror | init-7.scm | init-7.scm -- core library procedures for R7RS
Copyright ( c ) 2009 - 2012 . All rights reserved .
;; BSD-style license:
(define (caar x) (car (car x)))
(define (cadr x) (car (cdr x)))
(define (cdar x) (cdr (car x)))
(define (cddr x) (cdr (cdr x)))
(define (cons-source kar kdr source)
((lambda (pair)
... | null | https://raw.githubusercontent.com/spurious/chibi-scheme-mirror/49168ab073f64a95c834b5f584a9aaea3469594d/lib/init-7.scm | scheme | BSD-style license:
basic utils
map with a fast-path for single lists
syntax
library functions
booleans
char utils
string utils
list utils
vector utils
I/O utils
values
SRFI-0
(error "cond-expand: no expansions" expr)
dynamic-wind
Shared among all state spaces
syntax-rules
shortcut for (var ...)... | init-7.scm -- core library procedures for R7RS
Copyright ( c ) 2009 - 2012 . All rights reserved .
(define (caar x) (car (car x)))
(define (cadr x) (car (cdr x)))
(define (cdar x) (cdr (car x)))
(define (cddr x) (cdr (cdr x)))
(define (cons-source kar kdr source)
((lambda (pair)
(if (pair? source)
... |
dc4d2823b855c32f41407a2888b9b3e2f84001567eef7123e93e279938afe481 | iskandr/parakeet-retired | Simplify.mli | val simplify_fn : TypedSSA.fn -> TypedSSA.fn * bool | null | https://raw.githubusercontent.com/iskandr/parakeet-retired/3d7e6e5b699f83ce8a1c01290beed0b78c0d0945/SSA/Optimizations/Simplify.mli | ocaml | val simplify_fn : TypedSSA.fn -> TypedSSA.fn * bool | |
13a97fe56a33c8b8b4d0227c39ea5a6eb2161dfb1256b06a007c971981d4c175 | silky/quipper | CliffordT.hs | This file is part of Quipper . Copyright ( C ) 2011 - 2016 . Please see the
-- file COPYRIGHT for a list of authors, copyright holders, licensing,
-- and other details. All rights reserved.
--
-- ======================================================================
# LANGUAGE FlexibleContexts #
{-# LANGUAGE Rank2T... | null | https://raw.githubusercontent.com/silky/quipper/1ef6d031984923d8b7ded1c14f05db0995791633/QuipperLib/Decompose/CliffordT.hs | haskell | file COPYRIGHT for a list of authors, copyright holders, licensing,
and other details. All rights reserved.
======================================================================
# LANGUAGE Rank2Types #
| This module provides transformers for decomposing circuits into
the Clifford+/T/ gate base.
* [bold Contr... | This file is part of Quipper . Copyright ( C ) 2011 - 2016 . Please see the
# LANGUAGE FlexibleContexts #
it ensures that not - gates , /X/- , /Y/- , and /Z/-gates , and
/iX/-gates have at most two controls ; that phase gates of the form
one control .
single - qubit Clifford gates , /T/ , /T/[sup † ] , and... |
92f90fbbdc094ce30e44fdce4fd644a15aa9acfd2079ea5d6159c3db7f30f477 | interline/erlang-thrift | stress_server.erl | %%
Licensed to the Apache Software Foundation ( ASF ) under one
%% or more contributor license agreements. See the NOTICE file
%% distributed with this work for additional information
%% regarding copyright ownership. The ASF licenses this file
to you under the Apache License , Version 2.0 ( the
%% "License"); you ... | null | https://raw.githubusercontent.com/interline/erlang-thrift/1e0c2d2e529119d18614c16d35f7117469c26099/test/stress_server.erl | erlang |
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
"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 require... | Licensed to the Apache Software Foundation ( ASF ) under one
to you under the Apache License , Version 2.0 ( the
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(stress_server).
-export([start_link/1,
handle_function/2,
... |
9440e7947a7c3861f356569fba53e5698f1da7c5c718e7791e22eef2ed997781 | plumatic/grab-bag | google_analytics.clj | (ns dashboard.data.google-analytics
"Getting real-time users on site from google analytics.
Provisioned here: ~black-abode-606/apiui/credential?authuser=1
and by giving the email address below access to our google analytics account."
(:use plumbing.core)
(:require
[schema.core :as s]
[plumbing.auth :... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/service/dashboard/src/clj/dashboard/data/google_analytics.clj | clojure | removed | (ns dashboard.data.google-analytics
"Getting real-time users on site from google analytics.
Provisioned here: ~black-abode-606/apiui/credential?authuser=1
and by giving the email address below access to our google analytics account."
(:use plumbing.core)
(:require
[schema.core :as s]
[plumbing.auth :... |
8e4e073ba5c6db48002131ec3b4d597c2ce8804d4a60923e20e9e4336794efea | bollu/minitt | Christiansen2.hs | -- runhaskell Christiansen2.hs examples/untyped/christiansen-sec1.rkt
-- runhaskell Christiansen2.hs examples/untyped/christiansen-sec2.rkt
import System.Environment
import System.Exit
import Data.List
import AST
import Data.Either
import Control.Monad(foldM)
Now implement NBE
-- :main examples/untyped/christiansen... | null | https://raw.githubusercontent.com/bollu/minitt/5fab78717f6fc09a3c1d68980cbea0a18a31e28f/Christiansen2.hs | haskell | runhaskell Christiansen2.hs examples/untyped/christiansen-sec1.rkt
runhaskell Christiansen2.hs examples/untyped/christiansen-sec2.rkt
:main examples/untyped/christiansen-sec2.rkt
This is the sophisticated version that maintains a separate universe of "Neutral".
It should be possible to peform a more naive transla... |
import System.Environment
import System.Exit
import Data.List
import AST
import Data.Either
import Control.Monad(foldM)
Now implement NBE
type Name = String
data Exp =
Elam Name Exp
| Eident String
| Eap Exp Exp
deriving(Eq, Ord)
instance Show Exp where
show (Elam name exp) = "(λ " <> name <> "... |
b569e8b52747145632747ab108b5501bf4f55171641adb519d8f09c1a75e0f2c | macourtney/drift | test_execute.clj | (ns drift.test-execute
(:use clojure.test
drift.execute)
(:require [config.migrate-config :as config]
config.finished-config
[test-helper :as test-helper]))
(deftest test-version-number
(is (= 0 (version-number 0)))
(is (= 1 (version-number "1")))
(is (= Long/MAX_VAL... | null | https://raw.githubusercontent.com/macourtney/drift/b5cf735ab41ff2c95b0b1d9cf990faa342353171/test/drift/test_execute.clj | clojure | (ns drift.test-execute
(:use clojure.test
drift.execute)
(:require [config.migrate-config :as config]
config.finished-config
[test-helper :as test-helper]))
(deftest test-version-number
(is (= 0 (version-number 0)))
(is (= 1 (version-number "1")))
(is (= Long/MAX_VAL... | |
3285022100e8d8b96c1327d162d9151debfc990659818f3447ff2ecffd9aa4ce | meiersi/blaze-binary | CaseDist.hs | import Foreign
main = do
print $ map f [0..255]
test :: String
test = unlines $
"case x of" :
do i <- [0x00..0xff :: Word8]
return $ show i ++ " -> " ++ show (show i)
f :: Word8 -> String
f x = case x of
0 -> "0"
1 -> "1"
2 -> "2"
3 -> "3"
4 -> "4"
5 -> "5"
6 -> "6"
7 -> "7"
8 -> "... | null | https://raw.githubusercontent.com/meiersi/blaze-binary/9cc1ce1342896e7635681dca745b14b05d96d1bf/src/Codec/MsgPack/CaseDist.hs | haskell | import Foreign
main = do
print $ map f [0..255]
test :: String
test = unlines $
"case x of" :
do i <- [0x00..0xff :: Word8]
return $ show i ++ " -> " ++ show (show i)
f :: Word8 -> String
f x = case x of
0 -> "0"
1 -> "1"
2 -> "2"
3 -> "3"
4 -> "4"
5 -> "5"
6 -> "6"
7 -> "7"
8 -> "... | |
1517242191633321f9daa78bf31613ceac155ca699f6623372253657444f88a7 | someodd/burrow | Mustache.hs | | Stuff for managing templates .
{-# LANGUAGE OverloadedStrings #-}
module Mustache
( searchSpace
, getCompiledTemplate
, dataForMustache
, automaticCompileText
) where
import qualified Data.Text as T
import qualified Data.HashMap.Strict as H
import Text.Mustache.Compile
import Text.Mustache
imp... | null | https://raw.githubusercontent.com/someodd/burrow/fe93397c0339274f7c54bda0557d0030e9896f1e/src/Mustache.hs | haskell | # LANGUAGE OverloadedStrings #
| This is like `automaticCompile`, except we use `Text`.
Based of the documentation in Text.Mustache.Compile:
{ name :: String
, ast :: STree
, partials :: TemplateCache
Used for the main document parsing, I guess?
FIXME: what is this even?!
and regular... | | Stuff for managing templates .
module Mustache
( searchSpace
, getCompiledTemplate
, dataForMustache
, automaticCompileText
) where
import qualified Data.Text as T
import qualified Data.HashMap.Strict as H
import Text.Mustache.Compile
import Text.Mustache
import Text.Mustache.Parser
import Text . Musta... |
ed3a0032299efa4a39960de176f0a1a00b9c9d952310202c0dabc2e012d895a6 | stuarthalloway/programming-clojure | snippet.clj | (ns examples.snippet)
START : create - snippets
(require '[clojure.java.jdbc :as sql])
(defn create-snippets []
(sql/create-table :snippets
[:id :int "IDENTITY" "PRIMARY KEY"]
[:body :varchar "NOT NULL"]
[:created_at :datetime]))
; END: create-snippets
... | null | https://raw.githubusercontent.com/stuarthalloway/programming-clojure/192e2f28d797fd70e50778aabd031b3ff55bd2b9/src/examples/snippet.clj | clojure | END: create-snippets
replace "snippet-db" with a full path!
END: db
END: insert-snippets
END: print-snippets
Broken!
END: broken-select-snippets
END: select-snippets-doall
END: sql-query
END: last-created-id
END: insert-snippet | (ns examples.snippet)
START : create - snippets
(require '[clojure.java.jdbc :as sql])
(defn create-snippets []
(sql/create-table :snippets
[:id :int "IDENTITY" "PRIMARY KEY"]
[:body :varchar "NOT NULL"]
[:created_at :datetime]))
START : db
(def db {:c... |
04d2260051e513946529babd9513e147b34dd89a35983a57b723f4269c3f2320 | ErlyORM/boss_db | boss_db_adapter_mongodb_test.erl | -module(boss_db_adapter_mongodb_test).
-include_lib("proper/include/proper.hrl").
-include_lib("eunit/include/eunit.hrl").
-define(T_MODULE, boss_db_adapter_mongodb).
hex0_test() ->
?assert(proper:check_spec({?T_MODULE,hex0, 1},
[{to_file, user}])),
ok.
dec0_test() ->
?assert(proper:check_spec({?... | null | https://raw.githubusercontent.com/ErlyORM/boss_db/20060a061d3c4120929e4a4fedae1bb5e5830426/test/boss_db_adapter_mongodb_test.erl | erlang | build_conditions2_test() ->
[{to_file, user}])),
ok.
unpack_id_test() ->
[{to_file, user}])),
ok.
?assert(proper:quickcheck(prop_multiple_where_cluases_string(),
[{to_file,user}])),
ok.
prop_multiple_where_cluases_string() ->
?FORALL( ValueList,
?SIZED(Si... | -module(boss_db_adapter_mongodb_test).
-include_lib("proper/include/proper.hrl").
-include_lib("eunit/include/eunit.hrl").
-define(T_MODULE, boss_db_adapter_mongodb).
hex0_test() ->
?assert(proper:check_spec({?T_MODULE,hex0, 1},
[{to_file, user}])),
ok.
dec0_test() ->
?assert(proper:check_spec({?... |
7b3615ab2443088ed93a6ee2ad7436c6eeaabd22121bd464bf4217c332efd3ab | eponai/sulolive | aws_s3.clj | (ns eponai.server.external.aws-s3
(:require
[amazonica.aws.s3 :as aws-s3]
[s3-beam.handler :as s3]
[taoensso.timbre :refer [debug]]
[clojure.java.io :as io])
(:import (com.amazonaws.services.s3.model CannedAccessControlList AmazonS3Exception)))
(defprotocol IAWSS3
(sign [this])
(convert-to-rea... | null | https://raw.githubusercontent.com/eponai/sulolive/7a70701bbd3df6bbb92682679dcedb53f8822c18/src/eponai/server/external/aws_s3.clj | clojure | (debug "Try to upload photo: " p) | (ns eponai.server.external.aws-s3
(:require
[amazonica.aws.s3 :as aws-s3]
[s3-beam.handler :as s3]
[taoensso.timbre :refer [debug]]
[clojure.java.io :as io])
(:import (com.amazonaws.services.s3.model CannedAccessControlList AmazonS3Exception)))
(defprotocol IAWSS3
(sign [this])
(convert-to-rea... |
3fd231d26ef793170828b391f7de14c93e91ced9c4e79d974b75f0d2d3b005ae | input-output-hk/plutus-apps | Auction.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE NamedFieldPuns #-}
# LANGUAGE NoImplicitPrelude #
# LANGUAGE NumericUnderscores #
{-# LANGUAGE... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/8949ce26588166d9961205aa61edd66e4f83d4f5/plutus-use-cases/src/Plutus/Contracts/Auction.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE GADTs #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
# LANGUAGE ViewPatterns #
| Definition of an auction
^ Current owner of the asset. This ... | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE NumericUnderscores #
# LANGUAGE TypeApplications #
# OPTIONS_GHC -g -fplugin - opt PlutusTx . Plugin : coverage - all #
module Plutus.Contracts.Auction(
AuctionState(..),... |
c3fb6e4969c0ff55a420cea4817637e7bc901d9379d70c02a929116db700e40d | cyga/real-world-haskell | MultiplyTo.hs | -- file: ch14/MultiplyTo.hs
guarded :: Bool -> [a] -> [a]
guarded True xs = xs
guarded False _ = []
multiplyTo :: Int -> [(Int, Int)]
multiplyTo n = do
x <- [1..n]
y <- [x..n]
guarded (x * y == n) $
return (x, y)
| null | https://raw.githubusercontent.com/cyga/real-world-haskell/4ed581af5b96c6ef03f20d763b8de26be69d43d9/ch14/MultiplyTo.hs | haskell | file: ch14/MultiplyTo.hs | guarded :: Bool -> [a] -> [a]
guarded True xs = xs
guarded False _ = []
multiplyTo :: Int -> [(Int, Int)]
multiplyTo n = do
x <- [1..n]
y <- [x..n]
guarded (x * y == n) $
return (x, y)
|
73c3b5d2dc9fa8f3d001921f6dfb63398e9faaf50dc141ec33d1d8fe3a258f07 | ocaml-gospel/ortac | translation.ml | module W = Warnings
open Ppxlib
open Gospel
open Fmt
open Builder
open Translated
module F = Failure
module Ident = Identifier.Ident
let rec pattern pn =
let pattern' (p : Tterm.pattern) = pattern p.p_node in
match pn with
| Tterm.Pwild -> ppat_any
| Tterm.Pvar v -> pvar (str "%a" Ident.pp v.vs_name)
| Tterm... | null | https://raw.githubusercontent.com/ocaml-gospel/ortac/71a2c40942b6753c7b3f3bd0e025560d42b02b37/src/core/translation.ml | ocaml | [comb] extracts a bound from an the operator [f] and expression [e].
[right] indicates if [e] is on the right side of the operator.
XXX This is not the correct type or location, but it doesn't matter for
the translation
not very efficient
not very efficient
XXX ptlist must be rev because the cases ... | module W = Warnings
open Ppxlib
open Gospel
open Fmt
open Builder
open Translated
module F = Failure
module Ident = Identifier.Ident
let rec pattern pn =
let pattern' (p : Tterm.pattern) = pattern p.p_node in
match pn with
| Tterm.Pwild -> ppat_any
| Tterm.Pvar v -> pvar (str "%a" Ident.pp v.vs_name)
| Tterm... |
8bb0faf8cf29a6a7d4136e2210ca2f558e58e7c3058324b36955bf4c365bf7f8 | BoeingX/haskell-programming-from-first-principles | IntermissionExercises.hs | module Typeclasses.WritingTypeclassInstances.IntermissionExercises where
Question 1
data TisAnInteger = TisAn Integer
instance Eq TisAnInteger where
TisAn x == TisAn y = x == y
Question 2
data TwoIntegers = Two Integer Integer
instance Eq TwoIntegers where
Two x y == Two x' y' = x == x' && y == y'
Qu... | null | https://raw.githubusercontent.com/BoeingX/haskell-programming-from-first-principles/ffb637f536597f552a4e4567fee848ed27f3ba74/src/Typeclasses/WritingTypeclassInstances/IntermissionExercises.hs | haskell | module Typeclasses.WritingTypeclassInstances.IntermissionExercises where
Question 1
data TisAnInteger = TisAn Integer
instance Eq TisAnInteger where
TisAn x == TisAn y = x == y
Question 2
data TwoIntegers = Two Integer Integer
instance Eq TwoIntegers where
Two x y == Two x' y' = x == x' && y == y'
Qu... | |
cf9229c69e81eb952aabfcaa6e47fca7bc708eff3bb2af67175b709bab67663d | music-suite/music-suite | rtm.hs |
# LANGUAGE GeneralizedNewtypeDeriving #
import Music.Prelude
import Control.Applicative
import Numeric.Positive
import qualified Text.Parsec as P
data Rtm = Rtm BeatCount RtmList deriving (Eq, Ord, Show)
type BeatCount = Positive
type RtmList = [RtmValue]
data RtmValue
= RtmRest { _duration :: Positive }
... | null | https://raw.githubusercontent.com/music-suite/music-suite/7f01fd62334c66418043b7a2d662af127f98685d/sketch/rtm.hs | haskell | where |
# LANGUAGE GeneralizedNewtypeDeriving #
import Music.Prelude
import Control.Applicative
import Numeric.Positive
import qualified Text.Parsec as P
data Rtm = Rtm BeatCount RtmList deriving (Eq, Ord, Show)
type BeatCount = Positive
type RtmList = [RtmValue]
data RtmValue
= RtmRest { _duration :: Positive }
... |
85fd8fbcb35e25f355af482b34caafe7b91f658def6b18e3a360ea0cf0058656 | exoscale/collmann | core.clj | (ns io.exo.collmann.core
(:gen-class :init init)
(:import [org.collectd.api
Collectd
CollectdConfigInterface
CollectdWriteInterface
CollectdReadInterface])
(:require [clojure.string :as s]
[clojure.tools.logging :as log]
[io.exo.co... | null | https://raw.githubusercontent.com/exoscale/collmann/e786a6e65b4a446c0f4380152b10f6ec52d20304/src/io/exo/collmann/core.clj | clojure | (ns io.exo.collmann.core
(:gen-class :init init)
(:import [org.collectd.api
Collectd
CollectdConfigInterface
CollectdWriteInterface
CollectdReadInterface])
(:require [clojure.string :as s]
[clojure.tools.logging :as log]
[io.exo.co... | |
9f081e41cac716fb63b4de49876c8ee6a184a4e34f0ebbef45e68c951340219c | puppetlabs-toy-chest/cljs-dashboard-widgets | project.clj | (defproject puppetlabs/cljs-dashboard-widgets "0.1.1"
:description "A clojurescript library with widgets useful for metrics dashboards. Plays nicely with trapperkeeper-status and trapperkeeper-metrics."
:url "-dashboard-widgets"
:license {:name "Apache License, Version 2.0"
:url "-2.0"}
:source-pa... | null | https://raw.githubusercontent.com/puppetlabs-toy-chest/cljs-dashboard-widgets/80b921696e00bbe22d53927c6db3c26723aad736/project.clj | clojure | transitive dependencies
end transitive dependencies
transitive dependencies
end transitive dependencies
This is just here for reference, it really wouldn't make any sense
to build an uberjar for this project. | (defproject puppetlabs/cljs-dashboard-widgets "0.1.1"
:description "A clojurescript library with widgets useful for metrics dashboards. Plays nicely with trapperkeeper-status and trapperkeeper-metrics."
:url "-dashboard-widgets"
:license {:name "Apache License, Version 2.0"
:url "-2.0"}
:source-pa... |
aa29f14dbca760b488afaa771635c6f0c4ee5f75b97b705623f6394ae868c47f | reactiveml/rml | lco_ast.ml | (**********************************************************************)
(* *)
(* ReactiveML *)
(* *)
(* ... | null | https://raw.githubusercontent.com/reactiveml/rml/d3ac141bd9c6e3333b678716166d988ce04b5c80/compiler/lco/lco_ast.ml | ocaml | ********************************************************************
ReactiveML
... | Copyright 2002 , 2007 . All rights reserved .
version 1.0 .
- theme SPI , Laboratoire d'Informatique de Paris 6 ( 2002 - 2005 )
- Verimag , CNRS Grenoble ( 2005 - 2006 )
- projet , ( 2006 - 2007 ) ... |
60c7c38e90fec70331aea69837cc4d6d45a1e716277d24820c14ce99e306cb40 | Z572/guile-wlroots | keyboard.scm | (define-module (wlroots types keyboard)
#:use-module (oop goops)
#:use-module (wlroots types input-device)
#:use-module (wlroots types)
#:use-module (wlroots utils)
#:use-module (xkbcommon xkbcommon)
#:use-module ((bytestructures guile) #:select (bytestructure-ref))
#:use-module ((system foreign) #:prefix... | null | https://raw.githubusercontent.com/Z572/guile-wlroots/dc6cd05d5c46f811d75cbc30d1464820b19b1de8/wlroots/types/keyboard.scm | scheme | (define-module (wlroots types keyboard)
#:use-module (oop goops)
#:use-module (wlroots types input-device)
#:use-module (wlroots types)
#:use-module (wlroots utils)
#:use-module (xkbcommon xkbcommon)
#:use-module ((bytestructures guile) #:select (bytestructure-ref))
#:use-module ((system foreign) #:prefix... | |
916b4d75e3da46eff74234506cdbb62c2dc9a526e20cb91405b545f4b68b0818 | tisnik/clojure-examples | project.clj | ;
( C ) Copyright 2016 , 2020 , 2021
;
; All rights reserved. This program and the accompanying materials
; are made available under the terms of the Eclipse Public License v1.0
; which accompanies this distribution, and is available at
-v10.html
;
; Contributors:
;
(defproject topic-destructor ... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/a9976a44f4cdc332bf4e0ed7d9fbbef1a4b74523/kafka-topic-destructor/project.clj | clojure |
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
Contributors:
| ( C ) Copyright 2016 , 2020 , 2021
-v10.html
(defproject topic-destructor "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]
... |
d1f4a21723373e99c0c6b228c99f72b9825a89fb542082b05b586b9793325211 | fission-codes/fission | Types.hs | module Web.UCAN.Types
( UCAN (..)
, Claims (..)
, Proof (..)
, signEd25519
, signRS256
-- * reexports
, module Web.UCAN.Header.Types
, module Web.UCAN.RawContent
) where
import qualified System.IO.Unsafe as Unsafe
import Crypto.Hash
import Crypt... | null | https://raw.githubusercontent.com/fission-codes/fission/8b47050418c3ebf5736c0a09504230578341865d/hs-ucan/library/Web/UCAN/Types.hs | haskell | * reexports
Reexports
| An RFC 7519 extended with support for Ed25519 keys,
and some specifics (claims, etc) for Fission's use case
----------
Claims --
----------
Dramatis Personae
Temporal Bounds
---------
Proof --
---------
i.e. starts with Base64 encoded '{'
---------------------
Signature Helpers... | module Web.UCAN.Types
( UCAN (..)
, Claims (..)
, Proof (..)
, signEd25519
, signRS256
, module Web.UCAN.Header.Types
, module Web.UCAN.RawContent
) where
import qualified System.IO.Unsafe as Unsafe
import Crypto.Hash
import Crypto.Random ... |
2415034dc462a5f5e412c161dfae85d5190ddf4753561659ae7c72873bbab6ca | ndmitchell/shake | Rule.hs |
-- | This module is used for defining new types of rules for Shake build systems, e.g. to support values stored in a database.
-- Most users will find the built-in set of rules sufficient. The functions in this module are designed for high-performance,
-- not ease of use or abstraction. As a result, they are diffi... | null | https://raw.githubusercontent.com/ndmitchell/shake/99c5a7a4dc1d5a069b13ed5c1bc8e4bc7f13f4a6/src/Development/Shake/Rule.hs | haskell | | This module is used for defining new types of rules for Shake build systems, e.g. to support values stored in a database.
Most users will find the built-in set of rules sufficient. The functions in this module are designed for high-performance,
not ease of use or abstraction. As a result, they are difficult to... |
Before writing a builtin rule you are encouraged to use ' Development . ' or ' Development . Shake.addOracleCache ' if possible .
module Development.Shake.Rule(
* Builtin rules
$ builtin_rules
addBuiltinRule,
BuiltinLint, noLint, BuiltinIdentity, noIdentity, BuiltinRun, RunMode(..), RunChanged(..),... |
4448c4c2a2710ce625736e4d2746e00ea7c224a3d47f61f4628156c44c4c40ab | ocsigen/js_of_ocaml | vlq64.mli | Js_of_ocaml compiler
* /
* Copyright ( C ) 2013 Hugo Heuzard
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of th... | null | https://raw.githubusercontent.com/ocsigen/js_of_ocaml/58210fabc947c4839b6e71ffbbf353a4ede0dbb7/compiler/lib/vlq64.mli | ocaml | Js_of_ocaml compiler
* /
* Copyright ( C ) 2013 Hugo Heuzard
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of th... | |
8077e6f13577238bf844e5210bcd3df9d3acfe51aab128b1e9698c424901a851 | haroldcarr/learn-haskell-coq-ml-etc | MyTMVar.hs | module MyTMVar where
import Control.Concurrent.STM hiding (TMVar)
newtype TMVar a = TMVar (TVar (Maybe a))
newTMVar :: a -> STM (TMVar a)
newTMVar a = do
t <- newTVar (Just a)
return $ TMVar t
newTMVarIO :: a -> IO (TMVar a)
newTMVarIO = fmap TMVar . newTVarIO . Just
takeTMVar :: TMVar a -> STM a
takeTMVar (TM... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/course/2018-06-snoyman-applied-haskell-at-lambdaconf/all/src/MyTMVar.hs | haskell | module MyTMVar where
import Control.Concurrent.STM hiding (TMVar)
newtype TMVar a = TMVar (TVar (Maybe a))
newTMVar :: a -> STM (TMVar a)
newTMVar a = do
t <- newTVar (Just a)
return $ TMVar t
newTMVarIO :: a -> IO (TMVar a)
newTMVarIO = fmap TMVar . newTVarIO . Just
takeTMVar :: TMVar a -> STM a
takeTMVar (TM... | |
07000dd4d8231d4a6d76f27481709b70457faa5016b6680b4d901255e8fd6b7c | jml/servant-template | Logging.hs | # LANGUAGE FlexibleContexts #
-- | Logging helpers for {{ cookiecutter.project_name }}.
module {{ cookiecutter.module_name }}.Server.Logging
( LogM
, withLogging
, log
, fromKeyword
, toKeyword
) where
import Protolude hiding (Handler, log)
import Control.Monad.Catch (MonadMask)
import Control.Monad.Log
... | null | https://raw.githubusercontent.com/jml/servant-template/d2a44b6466ad8091da8aad39027dbb995e02b3d2/%7B%7B%20cookiecutter.project_name%20%7D%7D/%7B%7B%20cookiecutter.project_name%20%7D%7D-server/src/%7B%7B%20cookiecutter.module_name%20%7D%7D/Server/Logging.hs | haskell | | Logging helpers for {{ cookiecutter.project_name }}.
| Take a bunch of logs with severity and print them to stdout with timestamps.
A friend in need's a friend indeed.
| Convenience method to log with severity. | # LANGUAGE FlexibleContexts #
module {{ cookiecutter.module_name }}.Server.Logging
( LogM
, withLogging
, log
, fromKeyword
, toKeyword
) where
import Protolude hiding (Handler, log)
import Control.Monad.Catch (MonadMask)
import Control.Monad.Log
(Handler, LoggingT, MonadLog, Severity(..), WithTim... |
5cee4cc4c674af09fd86c06a58b00b520c0c50d9163599fc9b60d9262bb7d9bd | chenyukang/eopl | implicit-cases.scm | (define test-list
'(
;; simple arithmetic
(positive-const "11" 11)
(negative-const "-33" -33)
(simple-arith-1 "-(44,33)" 11)
;; nested arithmetic
(nested-arith-left "-(-(44,33),22)" -11)
(nested-arith-right "-(55, -(22,11))" 44)
;; simple unbound variables
... | null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch7/base/implicit-cases.scm | scheme | simple arithmetic
nested arithmetic
simple unbound variables
(test-unbound-var-1 "foo" error)
(test-unbound-var-2 "-(x,foo)" error)
simple conditionals
test dynamic typechecking
make sure that the test and both arms get evaluated
properly.
and make sure the other arm doesn't get evaluated.
simple let
check ne... | (define test-list
'(
(positive-const "11" 11)
(negative-const "-33" -33)
(simple-arith-1 "-(44,33)" 11)
(nested-arith-left "-(-(44,33),22)" -11)
(nested-arith-right "-(55, -(22,11))" 44)
(if-true "if zero?(0) then 3 else 4" 3)
(if-false "if zero?(1) then 3 else 4" 4)
... |
f0e23f2781412ec420ffa7821803859e03b61f13cd36925501b70c669a0ea08f | clj-commons/durable-queue | durable_queue_test.clj | (ns durable-queue-test
(:require
[clojure.java.io :as io]
[clojure.test :refer :all]
[durable-queue :refer :all]
[criterium.core :as c]))
(defn clear-tmp-directory []
(doseq [f (->> (#'durable-queue/directory->queue-name->slab-files "/tmp")
vals
(apply concat))]
(.de... | null | https://raw.githubusercontent.com/clj-commons/durable-queue/83452cbcc4c15a2244747e77b54a96a23e027691/test/durable_queue_test.clj | clojure | create a new manager, which will mark all in-progress tasks as incomplete
| (ns durable-queue-test
(:require
[clojure.java.io :as io]
[clojure.test :refer :all]
[durable-queue :refer :all]
[criterium.core :as c]))
(defn clear-tmp-directory []
(doseq [f (->> (#'durable-queue/directory->queue-name->slab-files "/tmp")
vals
(apply concat))]
(.de... |
7cbd032045a8e294dafb4cd9f6866d2ae325fcbad721b7c1071c6b840a0a5cd8 | sgrove/tehila | make_checker.scm | (define (make-check-image)
(let* ((check-image-height 64)
(check-image-width 64)
(buffer (make-u8vector (* check-image-width check-image-height 4) 0)))
(do ((i 0 (+ i 1))) ((> i check-image-height) buffer)
(do ((j 0 (+ j 1))) ((> j check-image-width))
(let ((c (if (or (equal? i 0) (e... | null | https://raw.githubusercontent.com/sgrove/tehila/576a89dc0a1be192ead407265bc2272cd6a55226/misc/make_checker.scm | scheme | (define (make-check-image)
(let* ((check-image-height 64)
(check-image-width 64)
(buffer (make-u8vector (* check-image-width check-image-height 4) 0)))
(do ((i 0 (+ i 1))) ((> i check-image-height) buffer)
(do ((j 0 (+ j 1))) ((> j check-image-width))
(let ((c (if (or (equal? i 0) (e... | |
0a2c30e77b55eaecce18a54034f61711471afe01db6ea9500154cd73c9f76a71 | cyverse-archive/DiscoveryEnvironmentBackend | root.clj | (ns donkey.services.filesystem.root
(:use [clojure-commons.validators])
(:require [clojure-commons.client :as http]
[clojure-commons.json :as json]
[dire.core :refer [with-pre-hook! with-post-hook!]]
[donkey.util.config :as cfg]
[donkey.services.filesystem.common-path... | null | https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/services/Donkey/src/donkey/services/filesystem/root.clj | clojure | (ns donkey.services.filesystem.root
(:use [clojure-commons.validators])
(:require [clojure-commons.client :as http]
[clojure-commons.json :as json]
[dire.core :refer [with-pre-hook! with-post-hook!]]
[donkey.util.config :as cfg]
[donkey.services.filesystem.common-path... | |
8e8128ae718059c8296e9a089e9613449c7512f868e471e06830014a76522212 | xh4/web-toolkit | classes.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
(in-package :it.bese.fiveam)
(defclass testable-object ()
((name :initarg :name :accessor name
:documentation "A symbol naming this test object.")
(description :initarg :description :accessor description :initform nil
:documentation "The tex... | null | https://raw.githubusercontent.com/xh4/web-toolkit/e510d44a25b36ca8acd66734ed1ee9f5fe6ecd09/vendor/fiveam-v1.4.1/src/classes.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and ... |
(in-package :it.bese.fiveam)
(defclass testable-object ()
((name :initarg :name :accessor name
:documentation "A symbol naming this test object.")
(description :initarg :description :accessor description :initform nil
:documentation "The textual description of this test object.")
(dep... |
b00cb4919454d6e998228c239fe642b08a4b8b84b8c7ec6008fb450254df1a6c | metaocaml/ber-metaocaml | t200-getfield3.ml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
type t = {
a : int;
b : int;
c : int;
d : int;
};;
if { a ... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/tool-ocaml/t200-getfield3.ml | ocaml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
type t = {
a : int;
b : int;
c : int;
d : int;
};;
if { a ... | |
ecdb08f751033145c4cd52070678bc72af98440d08c48abfb297a1da9044a70c | emotiq/emotiq | package.lisp | package.lisp
(defpackage #:emotiq
(:use #:cl)
We do n't need CL : BLOCK , want to use BLOCK in our package .
(:shadowing-import-from #:cl #:block)
(:export #:octet #:octet-vector #:octet-vector-p
#:make-octet-vector #:ovref
#:octet-vector-to-hex-string #:hex-string-to-octet-vector
... | null | https://raw.githubusercontent.com/emotiq/emotiq/9af78023f670777895a3dac29a2bbe98e19b6249/src/package.lisp | lisp | aka gossip's idea of its configuration | package.lisp
(defpackage #:emotiq
(:use #:cl)
We do n't need CL : BLOCK , want to use BLOCK in our package .
(:shadowing-import-from #:cl #:block)
(:export #:octet #:octet-vector #:octet-vector-p
#:make-octet-vector #:ovref
#:octet-vector-to-hex-string #:hex-string-to-octet-vector
... |
9544dbb200a8effb74e5ef06adc86a68937902195274e8612fee49eb5c0303cf | nathell/soupscraper | project.clj | I really wanted it to be a Leiningen - less project and use something
;; like uberdeps for the uberjar, but apparently there’s no escape,
;; because of this:
;; -log4j2-conflicts-in-uberjars
(defproject soupscraper "0.1.0-SNAPSHOT"
:main soupscraper.core
at least let 's not repeat
[arctype/log4j2-pl... | null | https://raw.githubusercontent.com/nathell/soupscraper/56b4927bb6c56dd541dc167c4d8f5db0cbdd9476/project.clj | clojure | like uberdeps for the uberjar, but apparently there’s no escape,
because of this:
-log4j2-conflicts-in-uberjars
apply the workaround
otherwise it'll complain, see -log4j2-compatible-with-java-11 | I really wanted it to be a Leiningen - less project and use something
(defproject soupscraper "0.1.0-SNAPSHOT"
:main soupscraper.core
at least let 's not repeat
:lein-tools-deps/config {:config-files [:install :user :project]}
:middleware [lein-tools-deps.plugin/resolve-dependencies-with-deps-edn
... |
f296c1e5e638fe7328b8ee9415b42fc782897e56abdbfcbe6e72b42f0b6a2797 | amperity/dialog | logger_test.clj | (ns dialog.logger-test
(:require
[clojure.string :as str]
[clojure.test :refer [deftest testing is]]
[dialog.logger :as log])
(:import
java.io.StringWriter
java.time.Instant))
(defmacro with-err-capture
"Evaluate the body of expressions with the `*err*` stream bound to a string
writer."
... | null | https://raw.githubusercontent.com/amperity/dialog/097149c5e97b9049ce55a5e665af38aab4d59f5f/test/dialog/logger_test.clj | clojure | (ns dialog.logger-test
(:require
[clojure.string :as str]
[clojure.test :refer [deftest testing is]]
[dialog.logger :as log])
(:import
java.io.StringWriter
java.time.Instant))
(defmacro with-err-capture
"Evaluate the body of expressions with the `*err*` stream bound to a string
writer."
... | |
4f7403e6529dd670227a58bce20c95b8369601e233c39e7befb881018f03c6b7 | marigold-dev/deku | deku_metrics.ml | FIXME : there are better ways to do this when we split the api from the consensus node ( PR # 879 )
let rec take n l =
match (n, l) with
| 0, _ -> []
| _, [] -> []
| n, hd :: tl -> hd :: take (n - 1) tl
type stats = { latency : float; tps : float }
let latest_tx_count = ref []
let set_latest_tx_count tx_c... | null | https://raw.githubusercontent.com/marigold-dev/deku/cdf82852196b55f755f40850515580be4fd9a3fa/deku-p/src/core/metrics/deku_metrics.ml | ocaml | FIXME : there are better ways to do this when we split the api from the consensus node ( PR # 879 )
let rec take n l =
match (n, l) with
| 0, _ -> []
| _, [] -> []
| n, hd :: tl -> hd :: take (n - 1) tl
type stats = { latency : float; tps : float }
let latest_tx_count = ref []
let set_latest_tx_count tx_c... | |
84bcb277ecf296f0f654ca8e0b4ccfbe81762309dc16cf946a975b17954c0129 | DaMSL/K3 | Expression.hs | # LANGUAGE LambdaCase #
# LANGUAGE ParallelListComp #
# LANGUAGE PatternSynonyms #
# LANGUAGE TupleSections #
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns #
module Language.K3.Codegen.CPP.Expression where
import Prelude hiding (any, concat)
import Control.Arrow ((&&&), (***), (>>>))
import Control.Monad.State
i... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/Codegen/CPP/Expression.hs | haskell | | The reification context passed to an expression determines how the result of that expression
will be stored in the generated code.
| Indicates that the calling context will ignore the callee's result.
| Indicates that the calling context is a C++ function, in which case the result may be
'returned' from the cal... | # LANGUAGE LambdaCase #
# LANGUAGE ParallelListComp #
# LANGUAGE PatternSynonyms #
# LANGUAGE TupleSections #
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns #
module Language.K3.Codegen.CPP.Expression where
import Prelude hiding (any, concat)
import Control.Arrow ((&&&), (***), (>>>))
import Control.Monad.State
i... |
ae75b24edf05245c251cc49fdb5477805a831bfbe07388b230cc0a8af855a701 | facebook/pyre-check | constraintsSet.mli |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/pyre-check/10c375bea52db5d10b71cb5206fac7da9549eb0c/source/analysis/constraintsSet.mli | ocaml | For testing
Only exposed for testing |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
6681f5adec110a919b672cddab3b2597efd5422d649d1f7d26995ce06c10ec97 | tweag/ormolu | application-2.hs | # LANGUAGE TemplateHaskell #
foo = do
$( bar
) baz
foo = do
$$( bar
) baz
foo = do
do (+1)
2
foo = do
do
(+1)
2
foo = do
case () of () -> (+1)
2
foo = do
case () of
() -> (+1)
2
foo = do
\case 2 -> 3
2
foo = do
\case
2 -> 3
2
| null | https://raw.githubusercontent.com/tweag/ormolu/c906ee7c0255e8117b1eb0be91c06efe8b2c2433/data/examples/declaration/value/function/application-2.hs | haskell | # LANGUAGE TemplateHaskell #
foo = do
$( bar
) baz
foo = do
$$( bar
) baz
foo = do
do (+1)
2
foo = do
do
(+1)
2
foo = do
case () of () -> (+1)
2
foo = do
case () of
() -> (+1)
2
foo = do
\case 2 -> 3
2
foo = do
\case
2 -> 3
2
| |
cc90c1e5d52f5679b6b29ea79e28a6ac8237422607d968816f1382487bbe3e14 | fmi/clojure-lectures | doc_table_test.clj | (ns lectures.doc-table-test
(:use clojure.test
lectures.doc-table))
(deftest doc-table-test
(testing "Collects all symbol documentation"
(with-doc-table
(gather-docs "(inc 1)")
(is (= {'inc (get-doc 'inc)} (get-doc-table)))))
(testing "Collects multiple forms"
(with-doc-table
(g... | null | https://raw.githubusercontent.com/fmi/clojure-lectures/e9aead137a25f3b01ba7b14d8949fe1e63b222e7/test/lectures/doc_table_test.clj | clojure | (ns lectures.doc-table-test
(:use clojure.test
lectures.doc-table))
(deftest doc-table-test
(testing "Collects all symbol documentation"
(with-doc-table
(gather-docs "(inc 1)")
(is (= {'inc (get-doc 'inc)} (get-doc-table)))))
(testing "Collects multiple forms"
(with-doc-table
(g... | |
b3bc08017d80a4ad0065444d303c4e761ad5aa8a857572b28050037b812ed380 | fiddlerwoaroof/cl-git | tree.lisp | (in-package :fwoar.cl-git)
(defclass git-tree (git-object)
((%entries :initarg :entries :reader entries)))
(defun git-tree (entries)
(fw.lu:new 'git-tree entries))
(defclass tree-entry ()
((%repo :initarg :repo :reader repository)
(%mode :initarg :mode :reader te-mode)
(%name :initarg :name :reader te-na... | null | https://raw.githubusercontent.com/fiddlerwoaroof/cl-git/fb9deed060d49dbb52f390f67b1783a13edf71b6/tree.lisp | lisp | (in-package :fwoar.cl-git)
(defclass git-tree (git-object)
((%entries :initarg :entries :reader entries)))
(defun git-tree (entries)
(fw.lu:new 'git-tree entries))
(defclass tree-entry ()
((%repo :initarg :repo :reader repository)
(%mode :initarg :mode :reader te-mode)
(%name :initarg :name :reader te-na... | |
2629c02aeb93ac8f25790e492a458face78fd7edd8f076a7b1f4839bc600cbd0 | audreyt/openafp | POCP.hs | module OpenAFP.Records.T.POCP where
import OpenAFP.Types
import OpenAFP.Internals
data T_POCP = T_POCP {
t_pocp_Type :: !N1
,t_pocp :: !NStr
} deriving (Show, Typeable)
| null | https://raw.githubusercontent.com/audreyt/openafp/178e0dd427479ac7b8b461e05c263e52dd614b73/src/OpenAFP/Records/T/POCP.hs | haskell | module OpenAFP.Records.T.POCP where
import OpenAFP.Types
import OpenAFP.Internals
data T_POCP = T_POCP {
t_pocp_Type :: !N1
,t_pocp :: !NStr
} deriving (Show, Typeable)
| |
022181a09b447d6fffab8d3f8dc323d9e96ab6077e8c2fad4d5b074a6b59a164 | archaelus/erlmail | mime.erl | %%%---------------------------------------------------------------------------------------
@author < > [ ]
2006 - 2007 Simple Enigma , Inc. All Rights Reserved .
@doc Multipurpose Internet Mail Extention functions
@reference See < a href=" / modules / erlmail " target="_top">Erlang Softwa... | null | https://raw.githubusercontent.com/archaelus/erlmail/fe69b0e936f1512b4f349666e56c31c0af7b672c/src/mime.erl | erlang | ---------------------------------------------------------------------------------------
@reference See <a href="" target="_top">ErlMail Google Code Repository</a> for more information
@version 0.0.6
@end
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software an... | @author < > [ ]
2006 - 2007 Simple Enigma , Inc. All Rights Reserved .
@doc Multipurpose Internet Mail Extention functions
@reference See < a href=" / modules / erlmail " target="_top">Erlang Software Framework</a > for more information
@since 0.0.6
The MIT License
Copyrig... |
369116421f358129f194e4f3b50d69761593718aff5bb36dd4eb6560e2f7cac7 | LuKC1024/stacker | utilities.rkt | #lang plait
(require (rename-in (typed-in racket [format : (String 'a -> String)])
[format raw-format]))
(define-syntax let-values
(syntax-rules ()
[(let-values (((x ...) e)) body)
(let ([tmp e])
(local ((define-values (x ...) tmp))
body))]))
(define (displayln x)
(be... | null | https://raw.githubusercontent.com/LuKC1024/stacker/879e38178a62f881cb440f54b08f574db820d0a6/utilities.rkt | racket | #lang plait
(require (rename-in (typed-in racket [format : (String 'a -> String)])
[format raw-format]))
(define-syntax let-values
(syntax-rules ()
[(let-values (((x ...) e)) body)
(let ([tmp e])
(local ((define-values (x ...) tmp))
body))]))
(define (displayln x)
(be... | |
f38c096eec5e8b494052a04d034ef94ff96003aaea57c7a7832d0fe50d3ff4b7 | deadpendency/deadpendency | DependencyIgnoreReport.hs | module Common.Model.Report.DependencyIgnoreReport
( DependencyIgnoreReport (..),
)
where
import Common.Aeson.Aeson
import Common.Model.Dependency.DependencyIdentifier
import Data.Aeson
newtype DependencyIgnoreReport = DependencyIgnoreReport
{ _dependencyIdentifier :: DependencyIdentifier
}
deriving stock (E... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/common/src/Common/Model/Report/DependencyIgnoreReport.hs | haskell | module Common.Model.Report.DependencyIgnoreReport
( DependencyIgnoreReport (..),
)
where
import Common.Aeson.Aeson
import Common.Model.Dependency.DependencyIdentifier
import Data.Aeson
newtype DependencyIgnoreReport = DependencyIgnoreReport
{ _dependencyIdentifier :: DependencyIdentifier
}
deriving stock (E... | |
087df5916062782f9895ed056e3a3213fe072d370ed56754ad33a1349e3a3fea | ftovagliari/ocamleditor | menu_tool_button.ml |
OCamlEditor
Copyright ( C ) 2010 - 2014
This file is part of OCamlEditor .
OCamlEditor 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 y... | null | https://raw.githubusercontent.com/ftovagliari/ocamleditor/53284253cf7603b96051e7425e85a731f09abcd1/src/gmisclib/menu_tool_button.ml | ocaml |
OCamlEditor
Copyright ( C ) 2010 - 2014
This file is part of OCamlEditor .
OCamlEditor 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 y... | |
ab296e11d6307ca28564cc4386dbb15adb35a7c0e8b48249556cd2f406e4c093 | jumarko/clojure-experiments | day_07.clj | (ns clojure-experiments.advent-of-code.advent-2022.day-06
"
Input:
The disk of your device is full and you need to navigate around the file system
and find directories that are good candidates for deletion.
Thus, your task is to determine the total size of each directory.
"
(:require
[clojure-experim... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/3add24c50232e9f942332c97013a44f20628b565/src/clojure_experiments/advent_of_code/advent_2022/day_07.clj | clojure | Part 1
then calculate the sum of their total sizes
file system is a tree
when it's :cd then add children;
when it's :ls then add siblings
TODO: calculate and add `:size` to all the elements that do not have it (that is directories)
do this recursively, bottom up
try to use `clojure.walk`
read input
solutions
... | (ns clojure-experiments.advent-of-code.advent-2022.day-06
"
Input:
The disk of your device is full and you need to navigate around the file system
and find directories that are good candidates for deletion.
Thus, your task is to determine the total size of each directory.
"
(:require
[clojure-experim... |
95392339b9c0d715e876388f35a7d7e7af7918419c7e20f4251735228ab63ab6 | tailrecursion/boot | project.clj | (defproject tailrecursion/boot "1.1.1"
:description "A dependency setup/build tool for Clojure."
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]]
:aot :all
:main tailrecursion.boot.loader)
| null | https://raw.githubusercontent.com/tailrecursion/boot/afdef9fee52937263774c70a9ddd81afb1f2601c/project.clj | clojure | (defproject tailrecursion/boot "1.1.1"
:description "A dependency setup/build tool for Clojure."
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]]
:aot :all
:main tailrecursion.boot.loader)
| |
2647419f74d74cc9a36af4bda81ec90f91ac1f55fd9f291a1c59aba26eb6a43c | kitlang/kit | TypeVarDeclaration.hs | module Kit.Compiler.Typers.TypeExpression.TypeVarDeclaration (typeVarDeclaration) where
import Control.Applicative
import Control.Exception
import Control.Monad
import Data.List
import Data.Maybe
import Kit.Ast
import Kit.Compiler.Binding
import Kit.Compiler.Context
import Kit.Compiler.Module
import Kit.Compiler.Scope... | null | https://raw.githubusercontent.com/kitlang/kit/2769a7a8e51fe4466c50439d1a1ebdad0fb79710/src/Kit/Compiler/Typers/TypeExpression/TypeVarDeclaration.hs | haskell | leave a dummy binding in the scope; since we're going to fail
anyway, we may be able to get more type info and will avoid
spurious "unknown identifier" errors downstream
(Defer e1) -> do
throwk $ InternalError "Not yet implemented" (Just pos) | module Kit.Compiler.Typers.TypeExpression.TypeVarDeclaration (typeVarDeclaration) where
import Control.Applicative
import Control.Exception
import Control.Monad
import Data.List
import Data.Maybe
import Kit.Ast
import Kit.Compiler.Binding
import Kit.Compiler.Context
import Kit.Compiler.Module
import Kit.Compiler.Scope... |
c80ac1745ab2ee12fdc8f0fe72c04d30ff8e71d5ba32dbcda16da8734b7edf21 | heroku/ehmon | ehmon.erl | %%%-------------------------------------------------------------------
Geoff Ca nt
@author nt < >
%% @version {@vsn}, {@date} {@time}
%% @doc ehmon public API
%% @end
%%%-------------------------------------------------------------------
-module(ehmon).
%% API
-export([ init/0
,update/1
,in... | null | https://raw.githubusercontent.com/heroku/ehmon/8831d2e138d866ac0f23206eb3436877a93633b9/src/ehmon.erl | erlang | -------------------------------------------------------------------
@version {@vsn}, {@date} {@time}
@doc ehmon public API
@end
-------------------------------------------------------------------
API
We store scheduler data from the last run here to compare.
========================================================... | Geoff Ca nt
@author nt < >
-module(ehmon).
-export([ init/0
,update/1
,info_report/1
,stdout_report/1
,report/1
]).
-record(state, {prev_times :: undefined | [pos_integer()],
current_times :: [pos_integer()]}).
init() ->
#state{prev_times =... |
38d188c4c4bfaf171c7e1967b1c11f7ee36104bed550512656b086f7685aa8f0 | lambdaisland/cljbox2d | hello_cljbox2d.clj | (ns lambdaisland.cljbox2d.demo.hello-cljbox2d
(:require [lambdaisland.cljbox2d :as b]
[lambdaisland.cljbox2d.quil :as bq]
[quil.core :as q :include-macros true]))
| null | https://raw.githubusercontent.com/lambdaisland/cljbox2d/7ad44434b8c0892d810acaac76584a43f1297240/src/lambdaisland/cljbox2d/demo/hello_cljbox2d.clj | clojure | (ns lambdaisland.cljbox2d.demo.hello-cljbox2d
(:require [lambdaisland.cljbox2d :as b]
[lambdaisland.cljbox2d.quil :as bq]
[quil.core :as q :include-macros true]))
| |
709f50bd0744e36718c4608546d3903287f56dc7004ed26162f25b75baea7f57 | evturn/programming-in-haskell | 08.7-abstract-machine.hs | data Expr =
Val Int
| Add Expr Expr
data Op =
EVAL Expr
| ADD Int
type Cont = [Op]
-- | A function that evaluates an expression in the context
-- of a control stack.
eval :: Expr -> Cont -> Int
-- | If the expression is an integer, it is already
-- evaluated and we begin executing the control stack.
e... | null | https://raw.githubusercontent.com/evturn/programming-in-haskell/0af2c48c8221b5bcd052492e2be2b79635f6994c/08-declaring-types-and-classes/08.7-abstract-machine.hs | haskell | | A function that evaluates an expression in the context
of a control stack.
| If the expression is an integer, it is already
evaluated and we begin executing the control stack.
| If the expression is an addition, we evaluate the
| A function that executes a control stack in the context
of an integer argument.
... | data Expr =
Val Int
| Add Expr Expr
data Op =
EVAL Expr
| ADD Int
type Cont = [Op]
eval :: Expr -> Cont -> Int
eval (Val n) c = exec c n
first argument , placing the operation ` EVAL y ` on
top of the control stack to indicate that the second
argument should be evaluated after the first argumen... |
59c610b4bf0e5c20bd88d77cc939c9e57ce5adb6d14b9574ceb4f19a451e76d2 | exoscale/clojure-kubernetes-client | rbac_authorization_v1beta1.clj | (ns clojure-kubernetes-client.api.rbac-authorization-v1beta1
(:require [clojure-kubernetes-client.core :refer [call-api check-required-params with-collection-format *api-context*]]
[clojure.spec.alpha :as s]
[spec-tools.core :as st]
[orchestra.core :refer [defn-spec]]
[... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/api/rbac_authorization_v1beta1.clj | clojure | (ns clojure-kubernetes-client.api.rbac-authorization-v1beta1
(:require [clojure-kubernetes-client.core :refer [call-api check-required-params with-collection-format *api-context*]]
[clojure.spec.alpha :as s]
[spec-tools.core :as st]
[orchestra.core :refer [defn-spec]]
[... | |
899c942f32861cbc6c3bd4baef0efab54f6f88008ac62f370ab8d85ee49037c5 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | PaymentPagesCheckoutSessionAfterExpiration.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
-- | Contains the types generated from the schema PaymentPagesCheckoutSessionAfterExpiration
module StripeAPI.Types.PaymentPa... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/PaymentPagesCheckoutSessionAfterExpiration.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Contains the types generated from the schema PaymentPagesCheckoutSessionAfterExpiration
# SOURCE #
| Create a new 'PaymentPagesCheckoutSessionAfterExpiration' with all required fields.
| Defines the object schema located at @components.schemas.payment_pages_ch... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module StripeAPI.Types.PaymentPagesCheckoutSessionAfterExpiration where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.... |
86022f663622f7bb1607b6ad6483b85461ff8246a96bc7bd0d5e9987ed6667d2 | theodormoroianu/SecondYearCourses | LambdaChurch_20210415165509.hs | module LambdaChurch where
import Data.Char (isLetter)
import Data.List ( nub )
class ShowNice a where
showNice :: a -> String
class ReadNice a where
readNice :: String -> (a, String)
data Variable
= Variable
{ name :: String
, count :: Int
}
deriving (Show, Eq, Ord)
var :: String -> Variable
var ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/LambdaChurch_20210415165509.hs | haskell | alpha-equivalence
subst u x t defines [u/x]t, i.e., substituting u for x in t
This substitution avoids variable captures so it is safe to be used when
reducing terms with free variables (e.g., if evaluating inside lambda abstractions)
^ substitution term
^ variable to be substitutes
^ term in which the substit... | module LambdaChurch where
import Data.Char (isLetter)
import Data.List ( nub )
class ShowNice a where
showNice :: a -> String
class ReadNice a where
readNice :: String -> (a, String)
data Variable
= Variable
{ name :: String
, count :: Int
}
deriving (Show, Eq, Ord)
var :: String -> Variable
var ... |
a7179b0ba1c669667b7457bf9d9a7a5bb7a7edbb6b1a1ee6b30980572ad36d92 | sbcl/sbcl | describe.lisp | the DESCRIBE system
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provide... | null | https://raw.githubusercontent.com/sbcl/sbcl/3b742bcd2822b1e7aba9863376cb8458ab249e18/src/code/describe.lisp | lisp | more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
Isn't this (NOT EXP) wrong if it's a syntactic closure?
Prints X on a single line, limiting output length by *PRINT-RIGHT-MARGIN*
-- good for... | the DESCRIBE system
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-IMPL")
Utils , move elsewhere .
(defun class-name-or-class (class)
(let ((name (c... |
5d37089bcdc86b62013103709614e18b5b4c5a0373913b808b59303ea26d93df | liarokapisv/danac | Helpers.hs | module Danac.Util.Helpers where
import Control.Monad.State.Strict (MonadState, put, get)
locally :: MonadState s m => m a -> m a
locally computation = do
oldState <- get
result <- computation
put oldState
return result
| null | https://raw.githubusercontent.com/liarokapisv/danac/662408790ea1bd18ef2462dce45b947e3b8efa74/src/Danac/Util/Helpers.hs | haskell | module Danac.Util.Helpers where
import Control.Monad.State.Strict (MonadState, put, get)
locally :: MonadState s m => m a -> m a
locally computation = do
oldState <- get
result <- computation
put oldState
return result
| |
84b38a5d06116fd2d23ca66ca0db2c32c5d70bbada308ffb951ee76d7d426fc6 | mwand/eopl3 | lang.scm | (module lang (lib "eopl.ss" "eopl")
;; grammar for the PROC language
(require "drscheme-init.scm")
(provide (all-defined-out))
;;;;;;;;;;;;;;;; grammatical specification ;;;;;;;;;;;;;;;;
(define the-lexical-spec
'((whitespace (whitespace) skip)
(comment ("%" (arbno (not #\... | null | https://raw.githubusercontent.com/mwand/eopl3/b50e015be7f021d94c1af5f0e3a05d40dd2b0cbf/chapter3/proc-lang/ds-rep/lang.scm | scheme | grammar for the PROC language
grammatical specification ;;;;;;;;;;;;;;;;
sllgen boilerplate ;;;;;;;;;;;;;;;; | (module lang (lib "eopl.ss" "eopl")
(require "drscheme-init.scm")
(provide (all-defined-out))
(define the-lexical-spec
'((whitespace (whitespace) skip)
(comment ("%" (arbno (not #\newline))) skip)
(identifier
(letter (arbno (or letter digit "_" "-" "?")))
s... |
5c8217695ad0d2d31712800883b303bf3e37fa04f4d49383ff734fab2b51b762 | brendanhay/amazonka | LensShareSummary.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived fr... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-wellarchitected/gen/Amazonka/WellArchitected/Types/LensShareSummary.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Module : Amazonka.WellArchitected.Types.LensShareSummary
Stability : auto-generated
| A lens share summary return object.
| Optional message to compliment the Status field.
|
The following record fields are available, with the corresponding lense... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
Derived from AWS service descriptions , licensed under Apache 2.0 .
Co... |
1a071f816d451da7df1b1f1819564e121b47f3a200e66d6b7bc359339e258503 | mirage/ocaml-fsevents | types.ml |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/mirage/ocaml-fsevents/5c6abdcc20ce284d88003ce3300e637f7514e5e7/lib_gen/types.ml | ocaml |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | |
078ccce5ec8c44187e9b0837eb1cba7c19273c77703733a7663a9c7096788e29 | tweag/capability | CountLog.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
-- | Demonstrates h... | null | https://raw.githubusercontent.com/tweag/capability/65271a22ff9c173579f889dc033231f80453b185/examples/CountLog.hs | haskell | # LANGUAGE BangPatterns #
| Demonstrates how to derive user-defined capabilities using this library.
The @StateT@ constructor has to be imported even though it is not used
--------------------------------------------------------------------
Logger Capability
Example program -----------------------------------------... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE UndecidableInstances #
module CountLog where
import Capability.Reader
i... |
5185dac61ed70f8e116184b3ac9fbb62336927f9e6777cb4c81eb467e2d463e7 | tlaplus/tlapm | e_fmt.mli | Formatting of expressions .
Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
open Tla_parser
open E_t
open Ctx
type ctx = hyp Deque.dq * int Ctx.ctx
val bump : ctx -> ctx
val adj : ctx -> Util.hint -> ctx * string
val adjs : ctx -> Util... | null | https://raw.githubusercontent.com/tlaplus/tlapm/7752fd1e1670c2c18358c235efee5d8adde16b54/src/expr/e_fmt.mli | ocaml | Formatting of expressions .
Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
open Tla_parser
open E_t
open Ctx
type ctx = hyp Deque.dq * int Ctx.ctx
val bump : ctx -> ctx
val adj : ctx -> Util.hint -> ctx * string
val adjs : ctx -> Util... | |
236b09999493de97b4abc5733d38abd6393feebf0b679095e0b357acfb05dba0 | coq/coq | args.mli | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/5a5284d271baa3cda215154eda46090e1ddd6c45/tools/coqdep/lib/args.mli | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
4a6087e9f13484cb94cffd1afb785c2bb2321dc1f25a88b650048e0fe720d0f2 | fgalassi/cs61a-sp11 | 4.23.scm | (define (analyze-sequence exps)
(define (execute-sequence procs env)
(cond ((null? (cdr procs)) ((car procs) env))
(else ((car procs) env)
(execute-sequence (cdr procs) env))))
(let ((procs (map analyze exps)))
(if (null? procs)
(error "Empty sequence -- ANALYZE"))
(lam... | null | https://raw.githubusercontent.com/fgalassi/cs61a-sp11/66df3b54b03ee27f368c716ae314fd7ed85c4dba/homework/4.23.scm | scheme | Consider the common case where the sequence has just one expression. What work
it will check if the it's the only procedure in the sequence and then execute
it
What about the execution procedure produced by the program in the text above?
it will just execute the procedure
correct anyway. | (define (analyze-sequence exps)
(define (execute-sequence procs env)
(cond ((null? (cdr procs)) ((car procs) env))
(else ((car procs) env)
(execute-sequence (cdr procs) env))))
(let ((procs (map analyze exps)))
(if (null? procs)
(error "Empty sequence -- ANALYZE"))
(lam... |
c338aaed848d5ba20ff0749c98da7215d242062ea2245926b2cdc571f301827c | MyDataFlow/ttalk-server | ejabberd_tmp_sup.erl | %%%----------------------------------------------------------------------
File : ejabberd_tmp_sup.erl
Author : < >
%%% Purpose : Supervisor for temporary processess
Created : 18 Jul 2003 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2011 ProcessOne
%%%
%%% This program is free software; you ca... | null | https://raw.githubusercontent.com/MyDataFlow/ttalk-server/07a60d5d74cd86aedd1f19c922d9d3abf2ebf28d/apps/ejabberd/src/ejabberd_tmp_sup.erl | erlang | ----------------------------------------------------------------------
Purpose : Supervisor for temporary processess
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,
but WITHOUT ANY WARR... | File : ejabberd_tmp_sup.erl
Author : < >
Created : 18 Jul 2003 by < >
ejabberd , Copyright ( C ) 2002 - 2011 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 G... |
ac288098ab1a2d2217b9c942549c8e76df8688e41a5a14040e99183d18c5f727 | macchiato-framework/macchiato-core | flash.cljs | (ns macchiato.middleware.flash
"Middleware that adds session-based flash store that persists only to the
next request in the same session.")
(defn flash-request
"Adds :flash key to request from :_flash in session."
[request]
(let [session (:session request)
flash (:_flash session)
session (di... | null | https://raw.githubusercontent.com/macchiato-framework/macchiato-core/14eac3dbc561927ee61b6127f30ef0b0269b2af6/src/macchiato/middleware/flash.cljs | clojure | (ns macchiato.middleware.flash
"Middleware that adds session-based flash store that persists only to the
next request in the same session.")
(defn flash-request
"Adds :flash key to request from :_flash in session."
[request]
(let [session (:session request)
flash (:_flash session)
session (di... | |
c4f6ed97bf7eea13ab82253a6c5d1f45b1f19c26a2ac3f09487f6cd04098aaa8 | sdiehl/galois-field | Tower.hs | # LANGUAGE UndecidableInstances #
module Data.Field.Galois.Tower
( TowerOfFields(..)
, (*^)
) where
import Protolude
import Data.Field.Galois.Base (GaloisField)
import Data.Field.Galois.Prime (Prime, fromP)
import Data.Field.Galois.Extension (Extension, IrreducibleMonic, pattern V)
import Data.Field.Galois.Bin... | null | https://raw.githubusercontent.com/sdiehl/galois-field/3b13705fe26ea1dc03e1a6d7dac4089085c5362d/src/Data/Field/Galois/Tower.hs | haskell | -----------------------------------------------------------------------------
Types
-----------------------------------------------------------------------------
| Embed @K@ into @L@ naturally.
-----------------------------------------------------------------------------
Instances
-----------------------------------... | # LANGUAGE UndecidableInstances #
module Data.Field.Galois.Tower
( TowerOfFields(..)
, (*^)
) where
import Protolude
import Data.Field.Galois.Base (GaloisField)
import Data.Field.Galois.Prime (Prime, fromP)
import Data.Field.Galois.Extension (Extension, IrreducibleMonic, pattern V)
import Data.Field.Galois.Bin... |
9c52fa80f56cbdac3f357a1e159a9f8521a5b5afe51bae2897f3246eee516f50 | input-output-hk/cardano-base | Class.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE EmptyCase #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE RankNTypes ... | null | https://raw.githubusercontent.com/input-output-hk/cardano-base/b2058e5f38bfb463b3e414d8fca6656d78f0236d/measures/src/Data/Measure/Class.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE DerivingVia #
# LANGUAGE EmptyCase #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# OPTIONS -Wno-unticked-promoted-constructors #
| See 'Measure'
* Exceptions
| ... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE TypeApplications #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module Data.Measure.Class
( BoundedMeasure (..)
, Measure (..)
, Dat... |
d37ead9fc693c31efda6d3f6d4802672eb6264233450839af12c988cddc26dbf | MLstate/opalang | qmlError.mli |
Copyright © 2011 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be useful , ... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/libqmlcompil/qmlError.mli | ocaml | * The type of the context of the error.
* Merging several context
*
Should be enough in the majority of cases for outputting a public error message.
*
Currently, we are waiting for refactoring about positions,
and we do not have them in many cases.
So, waiting for this refactoring, you can try ... |
Copyright © 2011 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be useful , ... |
4d0d310fb66f354c1ab04659fa56e41e1b97ad86ebeaf2c8122905f2397b1131 | onyx-platform/onyx-sql | util.clj | (ns onyx.plugin.util)
(def uuid-length 16)
(defn uuid-to-bytes
[uuid]
(let [bytes (.putLong (.putLong (java.nio.ByteBuffer/allocate uuid-length)
(.getMostSignificantBits uuid))
(.getLeastSignificantBits uuid))
array (.array bytes)]
array))
(defn... | null | https://raw.githubusercontent.com/onyx-platform/onyx-sql/08baa7f0cdfe59476632332d24eaa84b465b9443/src/onyx/plugin/util.clj | clojure | Create ByteBuffer with UUID bytes
Prepend it with 0 to make sure that result bigint is positive | (ns onyx.plugin.util)
(def uuid-length 16)
(defn uuid-to-bytes
[uuid]
(let [bytes (.putLong (.putLong (java.nio.ByteBuffer/allocate uuid-length)
(.getMostSignificantBits uuid))
(.getLeastSignificantBits uuid))
array (.array bytes)]
array))
(defn... |
5bcd6fb155d169b2f71b4e51d129a08690c8a54084225ff3be4ebda439512e0c | OCamlPro/ez_api | ezReq.ml | (**************************************************************************)
(* *)
(* Copyright 2018-2023 OCamlPro *)
(* *)
(* All righ... | null | https://raw.githubusercontent.com/OCamlPro/ez_api/5253f7dd8936e923290aa969ee43ebd3dc6fce2d/src/request/ezReq.ml | ocaml | ************************************************************************
Copyright 2018-2023 OCamlPro
All rights reserved. This ... | GNU Lesser General Public License version 2.1 , with the special
module Interface = struct
let get ?meth:_ ?headers:_ ?msg:_ _url f =
f @@ Error (-2, Some "No http client loaded")
let post ?meth:_ ?content_type:_ ?content:_ ?headers:_ ?msg:_ _url f =
f @@ Error (-2, Some "No http client loaded"... |
23fb6e117a4acc9b22a34bd24ac05f74fad2eac12b67f9bf70f636ceaf8ece1c | mbutterick/aoc-racket | test.rkt | #lang reader "lang.rkt"
aaaaa-bbb-z-y-x-123[abxyz]
a-b-c-d-e-f-g-h-987[abcde]
not-a-real-room-404[oarel]
totally-real-room-200[decoy] | null | https://raw.githubusercontent.com/mbutterick/aoc-racket/2c6cb2f3ad876a91a82f33ce12844f7758b969d6/2016/day04/test.rkt | racket | #lang reader "lang.rkt"
aaaaa-bbb-z-y-x-123[abxyz]
a-b-c-d-e-f-g-h-987[abcde]
not-a-real-room-404[oarel]
totally-real-room-200[decoy] | |
83f9158fa823a7d697966be1933442e54e7de62ebc1285a791924a6e4f50a360 | ulisses/Static-Code-Analyzer | Pdf.hs | ------------------------------------------------------------------------------
-- |
Author :
-- Stability : experimental
-- Portability : portable
--
-- This module is part of 'Static-Code-Analyzer', a library to automatic
calculate some metrics related with C99 and GNU C extensions code .
--
-- In ... | null | https://raw.githubusercontent.com/ulisses/Static-Code-Analyzer/4c3f6423d43e1bccb9d1cf04e74ae60d9170186f/Analyzer/Pdf.hs | haskell | ----------------------------------------------------------------------------
|
Stability : experimental
Portability : portable
This module is part of 'Static-Code-Analyzer', a library to automatic
In this module I implement the pdf exporter
-----------------------------------------------------------------... | Author :
calculate some metrics related with C99 and GNU C extensions code .
module Pdf where
import System.Process
import Latex
generatePDF out name m = do
let outT = toTex out
generateLatex outT name m
h <- runCommand ("latexmk -e '$pdflatex=q/pdflatex --shell-escape -synctex=1 %T/' -pdf ... |
d52c6eb9881644368870784fa26272354c4d028f59c052edef06e83274cf0a4c | tmattio/dream-cli | dream_cli.mli | (** Create a CLI to configure Dream applications. *)
val run
: ?interface:string
-> ?port:int
-> ?stop:unit Lwt.t
-> ?debug:bool
-> ?error_handler:Dream.error_handler
-> ?secret:string
-> ?old_secrets:string
-> ?prefix:string
-> ?https:bool
-> ?certificate_file:string
-> ?key_file:string
-> ?b... | null | https://raw.githubusercontent.com/tmattio/dream-cli/00a79c0993bbcb08f2b395e77a1a269134c63b62/lib/dream_cli.mli | ocaml | * Create a CLI to configure Dream applications. |
val run
: ?interface:string
-> ?port:int
-> ?stop:unit Lwt.t
-> ?debug:bool
-> ?error_handler:Dream.error_handler
-> ?secret:string
-> ?old_secrets:string
-> ?prefix:string
-> ?https:bool
-> ?certificate_file:string
-> ?key_file:string
-> ?builtins:bool
-> ?greeting:bool
-> ?adjust_termina... |
4b1147c971c979a09a87a0aa2427e0dcae6f04c5f2363c5a2f597f4c69835e6d | charlieg/Sparser | select.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
copyright ( c ) 1995 -- all rights reserved
;;;
;;; File: "select"
;;; Module: "interface;workbench:edge-view:"
version : 0.1 April 1995
broken out as own file 2/28/95
0.1 ( 4/21 ) added operations over * edges / inspect - b... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/interface/workbench/edge-view/select.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
File: "select"
Module: "interface;workbench:edge-view:"
-----------
de-select
-----------
---------------
simple select
---------------
the caller had better be sure that the edge is indeed
in the table
------------------------------
as ca... | copyright ( c ) 1995 -- all rights reserved
version : 0.1 April 1995
broken out as own file 2/28/95
0.1 ( 4/21 ) added operations over * edges / inspect - button *
(in-package :sparser)
(defun deselect-selected-edge/edges-view ()
(let* ((table *edges-table*)
(selections (ccl:selected-c... |
d38da4be098d54d764b5e4b5877b20319e785c6e7aa3b3537a4e7d1df2302ce5 | ocaml/dune | dune_rpc_server.ml | open Stdune
open Dune_rpc_private
open Fiber.O
module Session_id = Stdune.Id.Make ()
type error =
{ message : User_message.t
; details : (string * Dyn.t) list
}
exception Invalid_session of error
let () =
Printexc.register_printer (function
| Invalid_session { message; details } ->
let message =
... | null | https://raw.githubusercontent.com/ocaml/dune/4e83d1b80bd9a37de7e0d39d6f22873850314557/src/dune_rpc_server/dune_rpc_server.ml | ocaml | * Pending requests sent to the client. When a response is
received, the ivar for the response will be filled.
cwong: What to do here?
XXX log
already reported above | open Stdune
open Dune_rpc_private
open Fiber.O
module Session_id = Stdune.Id.Make ()
type error =
{ message : User_message.t
; details : (string * Dyn.t) list
}
exception Invalid_session of error
let () =
Printexc.register_printer (function
| Invalid_session { message; details } ->
let message =
... |
d13a3a8ae325295634e45c3feb3cc0f83d7a1ae8ba877420bbcdf13a45bc0a32 | atongen/setml | session.ml | type t = {
session_id: string;
player_id: int option;
token: string;
token_expiration: float;
}
let token_lifetime = 60.0
let make () = {
session_id = Crypto.random_hex ();
player_id = None;
token = Crypto.random_hex ();
token_expiration = Unix.time () +. token_lifetime
}
let to_strin... | null | https://raw.githubusercontent.com/atongen/setml/8afee909ba6656506a69f79fd8682b37f2d2928a/src/server/session.ml | ocaml | cookie expiration | type t = {
session_id: string;
player_id: int option;
token: string;
token_expiration: float;
}
let token_lifetime = 60.0
let make () = {
session_id = Crypto.random_hex ();
player_id = None;
token = Crypto.random_hex ();
token_expiration = Unix.time () +. token_lifetime
}
let to_strin... |
5f4bded59329e62c64fffa87d44be1b753e00e1702b6643a5c1bff2e8d657425 | Opetushallitus/ataru | ohjausparametrit_client_spec.clj | (ns ohjausparametrit.ohjausparametrit-client-spec
(:require [ataru.ohjausparametrit.ohjausparametrit-client :as oc]
[ring.util.http-response :as resp]
[clj-http.client :as http]
[speclj.core :refer :all]
[cheshire.core :as json]))
(def ohjausparametrit-resp {:PH_SS ... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/2d8ef1d3f972621e301a3818567d4e11219d2e82/spec/ohjausparametrit/ohjausparametrit_client_spec.clj | clojure | (ns ohjausparametrit.ohjausparametrit-client-spec
(:require [ataru.ohjausparametrit.ohjausparametrit-client :as oc]
[ring.util.http-response :as resp]
[clj-http.client :as http]
[speclj.core :refer :all]
[cheshire.core :as json]))
(def ohjausparametrit-resp {:PH_SS ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.