_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 |
|---|---|---|---|---|---|---|---|---|
10526ca224b255ed33e6af70b812760f8c8b055f2b33d9d523533d5689f11bdd | EMSL-NMR-EPR/Haskell-MFAPipe-Executable | Types.hs | -----------------------------------------------------------------------------
-- |
Module : Language .
Copyright : 2016 - 17 Pacific Northwest National Laboratory
-- License : ECL-2.0 (see the LICENSE file in the distribution)
--
-- Maintainer :
-- Stability : experimental
-- Portability : ... | null | https://raw.githubusercontent.com/EMSL-NMR-EPR/Haskell-MFAPipe-Executable/8a7fd13202d3b6b7380af52d86e851e995a9b53e/MFAPipe/src/Language/INCA/Types.hs | haskell | ---------------------------------------------------------------------------
|
License : ECL-2.0 (see the LICENSE file in the distribution)
Maintainer :
Stability : experimental
Portability : portable
---------------------------------------------------------------------------
* Arrows
* Chemical rea... | Module : Language .
Copyright : 2016 - 17 Pacific Northwest National Laboratory
This module exports types for the representation of INCA syntax .
module Language.INCA.Types
INCAArrow(..)
, INCAReaction(..) , INCAReactionSide(..) , INCAReactionPart(..)
, INCAFluxVar(..)
, INCAMetaboliteVar(..)
*... |
7121c8a7193e8f244b406653dfcbddb65d038949a67b6721b32643fc3e22e3a2 | dgiot/dgiot | emqx_boot.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2017 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/dgiot/dgiot/c601555e45f38d02aafc308b18a9e28c543b6f2c/src/emqx_boot.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2017 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_boot).
-export([is_enabled/1]).
-define(BOOT_MODULES, [router, broker, listeners]... |
78257a35546f7f88850eae7bba8656cdedb7668d3530af405c7688bb3855e671 | neilprosser/mr-maestro | validators.clj | (ns maestro.validators
(:require [bouncer
[core :as b]
[validators :as v]]
[clj-time.format :as fmt]
[clojure
[set :as set]
[string :as str]]
[maestro
[environments :as environments]
[util :as util]]
... | null | https://raw.githubusercontent.com/neilprosser/mr-maestro/469790fd712262016729c1d83d4b4e11869237a2/src/maestro/validators.clj | clojure | (ns maestro.validators
(:require [bouncer
[core :as b]
[validators :as v]]
[clj-time.format :as fmt]
[clojure
[set :as set]
[string :as str]]
[maestro
[environments :as environments]
[util :as util]]
... | |
1d7a5d743eff242f768ac5864c3a0b1ae932d28fc73877f18ae66e75f8badd06 | project-oak/hafnium-verification | typeOrigin.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/nullsafe/typeOrigin.mli | ocaml | * A null literal in the source
* A constant (not equal to null) in the source.
* A field access (result of expression `some_object.some_field`)
* A method's parameter
* A result of a method call
* A new object creation
* integer value - result of accessing array.length
* Result of accessing an array by index
* ... |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
df0f00f0d10e6c9f7ace1008c6f44d87d025462892c52cfadd923e13accd1116 | camsaul/methodical | clojure.clj | (ns methodical.impl.method-table.clojure
(:require
[clojure.core.protocols :as clojure.protocols]
[methodical.impl.method-table.common :as method-table.common]
[methodical.interface]
[methodical.util.describe :as describe]
[pretty.core :as pretty])
(:import
(methodical.interface MethodTable)))
(s... | null | https://raw.githubusercontent.com/camsaul/methodical/258d0d12e4b25077574bd1ad4a8b4cfaa9c2910b/src/methodical/impl/method_table/clojure.clj | clojure | (ns methodical.impl.method-table.clojure
(:require
[clojure.core.protocols :as clojure.protocols]
[methodical.impl.method-table.common :as method-table.common]
[methodical.interface]
[methodical.util.describe :as describe]
[pretty.core :as pretty])
(:import
(methodical.interface MethodTable)))
(s... | |
55fd96533f4080f33154e9b80b05dc936f0f2b209f041bf9108f276f8003b78e | int28h/HaskellTasks | 0004.hs |
Реализуйте оператор |-| , который возвращает модуль ему .
Реализуйте оператор |-|, который возвращает модуль разности переданных ему аргументов.
-}
x |-| y = abs(x - y) | null | https://raw.githubusercontent.com/int28h/HaskellTasks/38aa6c1d461ca5774350c68fa7dd631932f10f84/src/0004.hs | haskell |
Реализуйте оператор |-| , который возвращает модуль ему .
Реализуйте оператор |-|, который возвращает модуль разности переданных ему аргументов.
-}
x |-| y = abs(x - y) | |
c61d2156570cb426e72940f9f576b8eff062fc571d6937a0c9fb7ca728ed5b5e | kuis-isle3sw/IoPLMaterials | arm_noreg.ml | module S = Syntax
open Arm_spec
exception Error of string
let err s = raise (Error s)
= = = = メモリアクセス関連 = = = =
(* 「reg中のアドレスからoffsetワード目」をあらわすaddr *)
let mem_access reg offset = RI (reg, offset * 4)
let local_access i = mem_access Fp (-i-2)
Vm . Param は 0 から数えるものと仮定
let param_to_reg = function
0 -> A1
|... | null | https://raw.githubusercontent.com/kuis-isle3sw/IoPLMaterials/fa328e92fdaaf6986394f832ef689689930647cd/misc/miniml-compiler/arm_noreg.ml | ocaml | 「reg中のアドレスからoffsetワード目」をあらわすaddr
==== 仮想マシンコード --> アセンブリコード ==== | module S = Syntax
open Arm_spec
exception Error of string
let err s = raise (Error s)
= = = = メモリアクセス関連 = = = =
let mem_access reg offset = RI (reg, offset * 4)
let local_access i = mem_access Fp (-i-2)
Vm . Param は 0 から数えるものと仮定
let param_to_reg = function
0 -> A1
| 1 -> A2
| i -> err ("invalid paramet... |
56935317254150b3461141183ad5f28a6e4d2e04a06ba476cd37fec7b60f21a4 | hidaris/thinking-dumps | a9-6.rkt | #lang racket
(require "parenthec.rkt")
(define-union expr
(const expr)
(var n)
(if test conseq alt)
(mult exp1 exp2)
(sub1 exp)
(zero exp)
(letcc body)
(throw k-exp v-exp)
(let exp body)
(lambda body)
(app rator rand))
(define-registers *e* *env* *k* *v* *p* *n*)
(define value-of-cps
(lambda... | null | https://raw.githubusercontent.com/hidaris/thinking-dumps/05b6093c3d1239f06f3657cd3bd15bf5cd622160/c311/a9-6.rkt | racket | we don't need let/cc to grap cont, because we are cps!
discard outer k
!
(let ((f (lambda (f)
(lambda (n)
(* n ((f f) (sub1 n)))))))) | #lang racket
(require "parenthec.rkt")
(define-union expr
(const expr)
(var n)
(if test conseq alt)
(mult exp1 exp2)
(sub1 exp)
(zero exp)
(letcc body)
(throw k-exp v-exp)
(let exp body)
(lambda body)
(app rator rand))
(define-registers *e* *env* *k* *v* *p* *n*)
(define value-of-cps
(lambda... |
ee6ce11cec1b4110c132d24eac79e815142645f12434f362e88bf1ef4bdae12e | ekmett/ekmett.github.com | Zygo.hs | {-# OPTIONS_GHC -fglasgow-exts #-}
-----------------------------------------------------------------------------
-- |
Module : Control . Morphism . Zygo
Copyright : ( C ) 2008
-- License : BSD-style (see the file LICENSE)
--
Maintainer : < >
-- Stability : experimental
-- Portability... | null | https://raw.githubusercontent.com/ekmett/ekmett.github.com/8d3abab5b66db631e148e1d046d18909bece5893/haskell/category-extras-backup/src/Control/Morphism/Zygo.hs | haskell | # OPTIONS_GHC -fglasgow-exts #
---------------------------------------------------------------------------
|
License : BSD-style (see the file LICENSE)
Stability : experimental
Portability : non-portable (rank-2 polymorphism)
--------------------------------------------------------------------------
* D... | Module : Control . Morphism . Zygo
Copyright : ( C ) 2008
Maintainer : < >
module Control.Morphism.Zygo where
import Control.Arrow ((&&&))
import Control.Comonad
import Control.Comonad.Reader
import Control.Functor.Algebra
import Control.Functor.Extras
import Control.Functor.Fix
import Cont... |
cdd04d81bd571eee486f2e4f22c1f72e65d5dd760933ff877c371fee61416d24 | astrada/ocaml-extjs | ext_layout_SizePolicy.ml | class type t =
object('self)
method readsHeight : bool Js.t Js.readonly_prop
method readsWidth : bool Js.t Js.readonly_prop
method setsHeight : bool Js.t Js.readonly_prop
method setsWidth : bool Js.t Js.readonly_prop
end
class type configs =
object('self)
end
class type events =
object
end
... | null | https://raw.githubusercontent.com/astrada/ocaml-extjs/77df630a75fb84667ee953f218c9ce375b3e7484/lib/ext_layout_SizePolicy.ml | ocaml | class type t =
object('self)
method readsHeight : bool Js.t Js.readonly_prop
method readsWidth : bool Js.t Js.readonly_prop
method setsHeight : bool Js.t Js.readonly_prop
method setsWidth : bool Js.t Js.readonly_prop
end
class type configs =
object('self)
end
class type events =
object
end
... | |
49f1e22c1f590c1e65788cef082a62ecf6dfe8d6383dad002c3f7f396380fb20 | poscat0x04/telegram-types | Game.hs | module Web.Telegram.Types.Internal.Game where
import Common
import Web.Telegram.Types.Internal.Animation
import Web.Telegram.Types.Internal.MessageEntity
import Web.Telegram.Types.Internal.PhotoSize
-- | A game. Use BotFather to create and edit games,
-- their short names will act as unique identifiers.
data Game =... | null | https://raw.githubusercontent.com/poscat0x04/telegram-types/c09ccc81cff10399538894cf2d1273022c797e18/src/Web/Telegram/Types/Internal/Game.hs | haskell | | A game. Use BotFather to create and edit games,
their short names will act as unique identifiers.
| Title of the game
| Description of the game
| Photo that will be displayed in the game message in chats.
| Brief description of the game or high scores included in the game message.
Can be automatically edit... | module Web.Telegram.Types.Internal.Game where
import Common
import Web.Telegram.Types.Internal.Animation
import Web.Telegram.Types.Internal.MessageEntity
import Web.Telegram.Types.Internal.PhotoSize
data Game = Game
title :: Text,
description :: Text,
photo :: [PhotoSize],
text :: Maybe Text,
text... |
fb1754057dea0b14ce73cc927cbe8e371e32bd0e11d71ac8f3cacb77ce21e949 | kayceesrk/ocaml5-tutorial | game_of_life.ml | let n_times = try int_of_string Sys.argv.(1) with _ -> 50
let board_size = try int_of_string Sys.argv.(2) with _ -> 1024
let rg =
ref (Array.init board_size (fun _ -> Array.init board_size (fun _ -> Random.int 2)))
let rg' =
ref (Array.init board_size (fun _ -> Array.init board_size (fun _ -> Random.int 2)))
let b... | null | https://raw.githubusercontent.com/kayceesrk/ocaml5-tutorial/36989cd5ffe42d7fc0b2710443b612f27bc9af5d/src/game_of_life.ml | ocaml | lonely
overcrowded
lives
get birth
0, (0|1|2|4|5|6|7|8)
barren | let n_times = try int_of_string Sys.argv.(1) with _ -> 50
let board_size = try int_of_string Sys.argv.(2) with _ -> 1024
let rg =
ref (Array.init board_size (fun _ -> Array.init board_size (fun _ -> Random.int 2)))
let rg' =
ref (Array.init board_size (fun _ -> Array.init board_size (fun _ -> Random.int 2)))
let b... |
61c39ffc103bd060a25b06787dd0b4ee898d8d815286845f88215b866b1cb2b9 | pkpkpk/fress | bigint_test.cljs | (ns fress.impl.bigint-test
(:require [cljs.test :refer-macros [deftest is are testing async]]
[fress.impl.bigint :as bn :refer [bigint]]
[fress.util :refer [u8-array] :as util]
[fress.test-helpers :as helpers :refer [log is= seq= are-nums= float=]]))
(deftest bn64-bit-switch-test
... | null | https://raw.githubusercontent.com/pkpkpk/fress/4976ece964a24a14ebdc527bd685bbfbd228c4fd/src/test/fress/impl/bigint_test.cljs | clojure | (ns fress.impl.bigint-test
(:require [cljs.test :refer-macros [deftest is are testing async]]
[fress.impl.bigint :as bn :refer [bigint]]
[fress.util :refer [u8-array] :as util]
[fress.test-helpers :as helpers :refer [log is= seq= are-nums= float=]]))
(deftest bn64-bit-switch-test
... | |
2785cd4ab51c2c7893d4dfd38e11388c7868a2598235c9b30360d679b993e7b8 | Eonblast/Scalaxis | lb_psv_beh.erl | 2010 - 2011 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
d... | null | https://raw.githubusercontent.com/Eonblast/Scalaxis/10287d11428e627dca8c41c818745763b9f7e8d4/src/lb_psv_beh.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | 2010 - 2011 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
-module(lb_psv_beh).
-author('').
-vsn('$Id$ ').
-export([behaviour_info/1]).
-include("scalaris.hrl").
-spec be... |
0c4ffd229548317fec44e1fb35a71d2adbee0c4fd0a3c3e5debbc97335de41e6 | vouillon/osm | bloom.mli | OSM tools
* Copyright ( C ) 2013
*
* 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 the License , or ( at your opti... | null | https://raw.githubusercontent.com/vouillon/osm/a42d1bcc82a4ad73c26c81ac7a75f9f1c7470344/not_used/bloom.mli | ocaml | OSM tools
* Copyright ( C ) 2013
*
* 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 the License , or ( at your opti... | |
17d490e0686c2d04685a7abfad48f1bfaf426ab1cca35b73acf0e875d06aa430 | Deaf-Clojurian/sudoku-solver | input.clj | (ns sudoku-solver.fixture.input)
(def sudoku-matrix-valid
[{:quadrant :00
:values {:00 7 :01 3 :02 nil
:10 6 :11 nil :12 1
:20 nil :21 4 :22 nil}}
{:quadrant :01
:values {:00 9 :01 nil :02 nil
:10 3 :11 nil :12 nil
:20 nil :21 8 :22 nil}}
... | null | https://raw.githubusercontent.com/Deaf-Clojurian/sudoku-solver/223ef9fd178f96f13747fc99a32d76c94d890729/test/sudoku_solver/fixture/input.clj | clojure | (ns sudoku-solver.fixture.input)
(def sudoku-matrix-valid
[{:quadrant :00
:values {:00 7 :01 3 :02 nil
:10 6 :11 nil :12 1
:20 nil :21 4 :22 nil}}
{:quadrant :01
:values {:00 9 :01 nil :02 nil
:10 3 :11 nil :12 nil
:20 nil :21 8 :22 nil}}
... | |
15f9cc5d423eb095ac401859164372b8f98c8d82f30c726354de2258a7a59f04 | skanev/playground | 61.scm | SICP exercise 4.61
;
; The following rules implement a next-to relation that finds adjancent
; elements of a list.
;
; (rule (?x next-to ?y in (?x ?y . ?u)))
;
; (rule (?x next-to ?y in (?v . ?z))
; (?x next-to ?y in ?z))
;
; What will the response be to the following queries?
;
( ? x next - to ? y in ( 1 ( 2... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/04/61.scm | scheme |
The following rules implement a next-to relation that finds adjancent
elements of a list.
(rule (?x next-to ?y in (?x ?y . ?u)))
(rule (?x next-to ?y in (?v . ?z))
(?x next-to ?y in ?z))
What will the response be to the following queries?
| SICP exercise 4.61
( ? x next - to ? y in ( 1 ( 2 3 ) 4 ) )
( ? x next - to 1 in ( 2 1 3 1 ) )
(add-to-data-base!
'((rule (?x next-to ?y in (?x ?y . ?u)))
(rule (?x next-to ?y in (?v . ?z))
(?x next-to ?y in ?z))))
(define query-1 '(?x next-to ?y in (1 (2 3) 4)))
(define query-2 '(?x next-to 1 in (... |
47112b442f84b4f007571f104969235437976f47dec6fa69d5b88bce2c5ec7a0 | processone/grapherl | graph_web_app.erl | %%%-------------------------------------------------------------------
%% @doc graph_web public API
%% @end
%%%-------------------------------------------------------------------
-module(graph_web_app).
-behaviour(application).
%% Application callbacks
-export([start/2
,stop/1]).
%%=========================... | null | https://raw.githubusercontent.com/processone/grapherl/a45174ff9ffc8b68877b6985d6d05c4fbb868620/grapherl/apps/graph_web/src/graph_web_app.erl | erlang | -------------------------------------------------------------------
@doc graph_web public API
@end
-------------------------------------------------------------------
Application callbacks
====================================================================
API
======================================================... |
-module(graph_web_app).
-behaviour(application).
-export([start/2
,stop/1]).
start(_StartType, _StartArgs) ->
Dispatch = cowboy_router:compile(
[{'_', [
{"/", cowboy_static, {priv_file, graph_web, "index.html"}},
{"/metric/data/:metric_... |
322f9131df8f07ee5f1d46935e6fe88510c79dd7afbe2277eaf06b1f929dfee9 | tahnik/graphqlx | prettify.ml | (**
* Name: Prettify
*
* Given an AST, it prints out the contents
*)
open Types
open Printf
let spaces : int ref = ref 0;;
let print_spaces amount =
for i = 1 to amount do
printf " "
done
let rec print definitions =
spaces := 0;
(
match definitions with
| [] -> printf "\n"
| def::defs... | null | https://raw.githubusercontent.com/tahnik/graphqlx/4a3dea80891c0f8aa16a98485f5c9a3b6d0fe88c/lib/ocaml/prettify/prettify.ml | ocaml | *
* Name: Prettify
*
* Given an AST, it prints out the contents
|
open Types
open Printf
let spaces : int ref = ref 0;;
let print_spaces amount =
for i = 1 to amount do
printf " "
done
let rec print definitions =
spaces := 0;
(
match definitions with
| [] -> printf "\n"
| def::defs -> read_definition def; print defs
);
and read_definition def =
ma... |
768350e0b4fed77872f5e3ac7ca2d6ef837cedfce5ffb23832b975d86fef5a85 | janestreet/sexp | parts.mli | open! Core
module Path : sig
type t = Sexplib.Path.t
val to_string : t -> string
end
type t = (Sexplib.Path.t * Sexp.t) list
val flatten : Sexp.t -> t
val assemble : t -> Sexp.t
val input : In_channel.t -> t
val output : t -> Out_channel.t -> unit
| null | https://raw.githubusercontent.com/janestreet/sexp/56e485b3cbf8a43e1a8d7647b0df31b27053febf/sexp_app/src/parts.mli | ocaml | open! Core
module Path : sig
type t = Sexplib.Path.t
val to_string : t -> string
end
type t = (Sexplib.Path.t * Sexp.t) list
val flatten : Sexp.t -> t
val assemble : t -> Sexp.t
val input : In_channel.t -> t
val output : t -> Out_channel.t -> unit
| |
1fbd6a1685824e38b83aca4187bff7542b970c487861884a679c4bfad121d53e | fbielejec/cljs-firebase-client | firebase.cljs | (ns events.firebase
(:require [firebase.auth :as firebase-auth]
[firebase.firestore :as firebase-db]
[re-frame.core :as re-frame]))
(def interceptors [re-frame/trim-v])
(re-frame/reg-fx
::email-login!
(fn [args]
(firebase-auth/email-login args)))
(re-frame/reg-event-fx
::email-login
... | null | https://raw.githubusercontent.com/fbielejec/cljs-firebase-client/78ea3354c77da81b55eb6052bc75a2a3f657bc28/src/events/firebase.cljs | clojure | (ns events.firebase
(:require [firebase.auth :as firebase-auth]
[firebase.firestore :as firebase-db]
[re-frame.core :as re-frame]))
(def interceptors [re-frame/trim-v])
(re-frame/reg-fx
::email-login!
(fn [args]
(firebase-auth/email-login args)))
(re-frame/reg-event-fx
::email-login
... | |
fab3e26af04ad6624400b35ef8f73e36afb8345c08f8e485673173cb78b3d1f2 | coccinelle/coccinelle | main.ml |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/57cbff0c5768e22bb2d8c20e8dae74294515c6b3/engine/main.ml | ocaml | -----------------------------------------------------------------------
Entry point |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... |
55a3e261f51e7d890ee8d1fb1d4fe65314be98a3fe4c3958d409465b4c6677f3 | kidpollo/jackdaw-literate-examples | writer_specs.clj | (ns prod-app.specs.writer-specs
"Spec for writes to internal state and message streams.
Use this spec for validation BEFORE WRITING TO INTERNAL STATE or publishing messages to Kafka."
(:require [clojure.spec.alpha :as s]
[prod-app.specs.attributes]))
(s/def ::loan-application
(s/keys :req-un [:meta... | null | https://raw.githubusercontent.com/kidpollo/jackdaw-literate-examples/9f3eca7415c0c4d460ab114eca675901a6c32114/prod-app/src/prod_app/specs/writer_specs.clj | clojure | (ns prod-app.specs.writer-specs
"Spec for writes to internal state and message streams.
Use this spec for validation BEFORE WRITING TO INTERNAL STATE or publishing messages to Kafka."
(:require [clojure.spec.alpha :as s]
[prod-app.specs.attributes]))
(s/def ::loan-application
(s/keys :req-un [:meta... | |
523408bb400810aa66a67a26051b9c1b6f30a1f6a2202cd73b114f3e3e559ab4 | lambdamikel/DLMAPS | polygons.lisp | -*- Mode : Lisp ; Syntax : Ansi - Common - Lisp ; Package : GEOMETRY ; Base : 10 -*-
(in-package geometry)
(defconstant +granularity+ 20)
(defmethod make-arc ((pfrom geom-point)
(pto geom-point)
xc yc &key (granularity +granularity+))
(multiple-value-bind (radius from)
(distance-and-orientat... | null | https://raw.githubusercontent.com/lambdamikel/DLMAPS/7f8dbb9432069d41e6a7d9c13dc5b25602ad35dc/src/geometry/polygons.lisp | lisp | Syntax : Ansi - Common - Lisp ; Package : GEOMETRY ; Base : 10 -*- |
(in-package geometry)
(defconstant +granularity+ 20)
(defmethod make-arc ((pfrom geom-point)
(pto geom-point)
xc yc &key (granularity +granularity+))
(multiple-value-bind (radius from)
(distance-and-orientation* xc yc (x pfrom) (y pfrom))
(multiple-value-bind (radius1 to)
(distance... |
e9a00c1e791405632f872200265c83404cf9568b093d6ebf399b21aa70c2dfa6 | digitallyinduced/ihp | HaskellParser.hs | module IHP.HSX.HaskellParser (parseHaskellExpression) where
import Prelude
import GHC.Parser.Lexer (ParseResult (..), PState (..))
import qualified GHC.Parser.Errors.Ppr as ParserErrorPpr
import GHC.Types.SrcLoc
import qualified GHC.Parser as Parser
import qualified GHC.Parser.Lexer as Lexer
import GHC.Data.FastString... | null | https://raw.githubusercontent.com/digitallyinduced/ihp/7ba2bb2c33c4604a43e5d7f72954dd41fff4ebc4/ihp-hsx/IHP/HSX/HaskellParser.hs | haskell | module IHP.HSX.HaskellParser (parseHaskellExpression) where
import Prelude
import GHC.Parser.Lexer (ParseResult (..), PState (..))
import qualified GHC.Parser.Errors.Ppr as ParserErrorPpr
import GHC.Types.SrcLoc
import qualified GHC.Parser as Parser
import qualified GHC.Parser.Lexer as Lexer
import GHC.Data.FastString... | |
671cc8096878b3cabee40e418e79562e3a10951210df02633e3f1b597af3a9dc | chetmurthy/poly-protobuf | test25_ml.ml | module T = Test25_types
module Pb = Test25_pb
module Pp = Test25_pp
let decode_ref_data () = T.({f1 = [1l;2l;3l;4l] })
let mode = Test_util.parse_args ()
let () =
match mode with
| Test_util.Decode ->
Test_util.decode "test25.c2ml.data" Pb.decode_m Pp.pp_m
(decode_ref_data ())
| Test_u... | null | https://raw.githubusercontent.com/chetmurthy/poly-protobuf/1f80774af6472fa30ee2fb10d0ef91905a13a144/tests/testdata/integration-tests/test25_ml.ml | ocaml | module T = Test25_types
module Pb = Test25_pb
module Pp = Test25_pp
let decode_ref_data () = T.({f1 = [1l;2l;3l;4l] })
let mode = Test_util.parse_args ()
let () =
match mode with
| Test_util.Decode ->
Test_util.decode "test25.c2ml.data" Pb.decode_m Pp.pp_m
(decode_ref_data ())
| Test_u... | |
87b8630950f34a9ce80664f18d0881f9accd1f452369b54142632d1562650e9c | nuscr/nuscr | efsm.ml | open! Base
open Message
open Printf
open Ltype
open Names
open Graph
type refinement_action_annot =
{ silent_vars: (VariableName.t * Expr.payload_type) list
; rec_expr_updates: Expr.t list }
[@@deriving ord, sexp_of]
let show_refinement_actions_annot {silent_vars; rec_expr_updates} =
let silent_vars =
if Li... | null | https://raw.githubusercontent.com/nuscr/nuscr/afef8aa7b0452e51b48cd101278512dcd7869b3b/lib/mpst/efsm.ml | ocaml | open! Base
open Message
open Printf
open Ltype
open Names
open Graph
type refinement_action_annot =
{ silent_vars: (VariableName.t * Expr.payload_type) list
; rec_expr_updates: Expr.t list }
[@@deriving ord, sexp_of]
let show_refinement_actions_annot {silent_vars; rec_expr_updates} =
let silent_vars =
if Li... | |
b6dcaeacbf5bd13f615043778733574d910d9c9fb4127739c4a50947c745d1ba | pbrisbin/yesod-goodies | Shorten.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE FlexibleInstances #
-------------------------------------------------------------------------------
-- |
-- Module : Data.Shorten
Copyright : ( c ) 2010
-- License : as-is
--
-- Maintainer :
-- Stability ... | null | https://raw.githubusercontent.com/pbrisbin/yesod-goodies/effa9f67b45e7be236ae8037a60a21b406ef05f8/shorten-strings/Data/Shorten.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE TypeSynonymInstances #
-----------------------------------------------------------------------------
|
Module : Data.Shorten
License : as-is
Maintainer :
Stability : unstable
Portability : unportable
-------------------------------------------------... | # LANGUAGE FlexibleInstances #
Copyright : ( c ) 2010
module Data.Shorten (Shorten(..)) where
import Data.Text (Text)
import qualified Data.Text as T
class Shorten a where
shorten :: Int -> a -> a
instance Shorten String where
shorten n s = if length s > n then take (n - 3) s ++ "..." else s
in... |
7ee88ab83b8ef5a464ff3e2d7e3ea2113e46b7595fe986ef499a5ab73abd1173 | savonet/ocaml-mm | dictee.ml | open Mm_audio
open Mm_midi
module FFT = Audio.Mono.Analyze.FFT
let polyphony = 1
let mchan = 0
let oss_out = true
let list_diff cmp l1 l2 =
List.fold_left
(fun acc x -> if not (List.exists (cmp x) l2) then x :: acc else acc)
[] l1
let rec list_head_n n l =
if n = 0 then []
else (match l with h :: t -> ... | null | https://raw.githubusercontent.com/savonet/ocaml-mm/3f9e7d0d8da358383fd62e02b476e8fca59fe137/examples/dictee.ml | ocaml | open Mm_audio
open Mm_midi
module FFT = Audio.Mono.Analyze.FFT
let polyphony = 1
let mchan = 0
let oss_out = true
let list_diff cmp l1 l2 =
List.fold_left
(fun acc x -> if not (List.exists (cmp x) l2) then x :: acc else acc)
[] l1
let rec list_head_n n l =
if n = 0 then []
else (match l with h :: t -> ... | |
e0bf7a72ea833b81b1410af6c65e494db413b53434c532160b431108cecd228c | keera-studios/haskell-titan | ReactiveModel.hs | -- | This module holds the reactive program model. It holds a program
-- model, but includes events that other threads can listen to, so
-- that a change in a part of the model is notified to other parts of
-- the program. The reactive model is not necessarily concurrent (it
-- doesn't have its own thread), although a ... | null | https://raw.githubusercontent.com/keera-studios/haskell-titan/958ddd2b468af00db46004a683c1c7aebe81526c/titan/src/Model/ReactiveModel.hs | haskell | | This module holds the reactive program model. It holds a program
model, but includes events that other threads can listen to, so
that a change in a part of the model is notified to other parts of
the program. The reactive model is not necessarily concurrent (it
doesn't have its own thread), although a facility i... | Copyright : ( C ) Keera Studios Ltd , 2018
Maintainer :
module Model.ReactiveModel
( ReactiveModel
, emptyRM
, pendingEvents
, pendingHandlers
, getPendingHandler
, onEvent
, module Exported
)
where
import Model.ReactiveModel.ReactiveModelInternals
import Hails.MVC.Model.ReactiveMod... |
54b5dcd4ea7d0ce8e777612a0e79b56bd3dec6a45c4030a0d55b4a26640c833a | keera-studios/keera-hails | Config.hs | -- |
--
Copyright : ( C ) Keera Studios Ltd , 2013
-- License : BSD3
Maintainer :
module Hails.MVC.Controller.Conditions.Config where
import qualified Control.Exception as E
import Control.Monad
import System.FilePath
import System.Directory
import Control.Exception.Extra
... | null | https://raw.githubusercontent.com/keera-studios/keera-hails/bf069e5aafc85a1f55fa119ae45a025a2bd4a3d0/keera-hails-mvc-solutions-config/src/Hails/MVC/Controller/Conditions/Config.hs | haskell | |
License : BSD3
| A config IO layer reads and writes
an environment from a string. It's like a
read/show combination for configuration files
to and from Environments
Reader
Shower | Copyright : ( C ) Keera Studios Ltd , 2013
Maintainer :
module Hails.MVC.Controller.Conditions.Config where
import qualified Control.Exception as E
import Control.Monad
import System.FilePath
import System.Directory
import Control.Exception.Extra
)
defaultRe... |
080afa90498e8089604514ad0fc0d498e5a4aeaf0f41b84cae15bed6bef56266 | felipereigosa/mock-mechanics | matrix.clj | (ns mockmechanics.library.matrix
(:import mockmechanics.java.Matrix))
(defn get-identity []
(float-array [1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1]))
(defn get-rotation [angle x y z]
(let [matrix (get-identity)]
(Matrix/setRotateM matrix angle x y z)
matrix))
(def... | null | https://raw.githubusercontent.com/felipereigosa/mock-mechanics/93070a789f5b24a7b34643bc11f47f8cf6112f8d/src/mockmechanics/library/matrix.clj | clojure | (ns mockmechanics.library.matrix
(:import mockmechanics.java.Matrix))
(defn get-identity []
(float-array [1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1]))
(defn get-rotation [angle x y z]
(let [matrix (get-identity)]
(Matrix/setRotateM matrix angle x y z)
matrix))
(def... | |
6c5735f0ea571e69adcf83a035d1a37820a84c069b7e0daa3c0dbfcfa9733e79 | soulomoon/SICP | Exercise5.06.scm | Exercise 5.6 : observes that the machine ’s controller sequence has an extra save and an extra restore , which can be removed to make a faster machine . Where are these instructions ?
(load "/Users/soulomoon/git/SICP/Chapter5/ch5-regsim.scm")
(define (print x)
(newline )
(display x)
(newline ))
;Recursive ex... | null | https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter5/Exercise5.06.scm | scheme | Recursive exponentiation:
save old value of n
clobber n to n-1
perform recursive call
(restore continue) ;here extra-restore
(save continue) ;here extra-save
return to caller,
answer is in val
base case: Fib(n) = n
memory limit : 128 MB .
(REGISTER SIMULATOR LOADED)
'done
'done
'done
'done
> | Exercise 5.6 : observes that the machine ’s controller sequence has an extra save and an extra restore , which can be removed to make a faster machine . Where are these instructions ?
(load "/Users/soulomoon/git/SICP/Chapter5/ch5-regsim.scm")
(define (print x)
(newline )
(display x)
(newline ))
(define fib-m... |
e74a3a5ba22360a8f5479f3b2d40787a68c352abc0a2790af0948a8eb16c4cbf | OCamlPro/liquidity | loveTarget.ml | open LiquidTypes
open Dune_Network_Lib
open Protocol
open LiquidClientSigs
open Love_parsing
open Love_type
open Love_ast_types
module Liquidity = LiquidityLang
module Target = struct
open Dune_Network_Lib
type const = Love_value.Value.t
type contract = AST.top_contract
type location = AST.location
type d... | null | https://raw.githubusercontent.com/OCamlPro/liquidity/3578de34cf751f54b9e4c001a95625d2041b2962/tools/client/loveTarget.ml | ocaml | LiquidData.translate_const_exp const | open LiquidTypes
open Dune_Network_Lib
open Protocol
open LiquidClientSigs
open Love_parsing
open Love_type
open Love_ast_types
module Liquidity = LiquidityLang
module Target = struct
open Dune_Network_Lib
type const = Love_value.Value.t
type contract = AST.top_contract
type location = AST.location
type d... |
fe0684b1ee57244f6ac1e049c209abdb1b3a250c032f5f2b65e95dfb7fa738bd | sky-big/RabbitMQ | rabbit_mgmt_wm_parameter.erl | The contents of this file are subject to the Mozilla Public License
Version 1.1 ( the " License " ) ; you may not use this file except in
%% compliance with the License. You may obtain a copy of the License at
%% /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITH... | null | https://raw.githubusercontent.com/sky-big/RabbitMQ/d7a773e11f93fcde4497c764c9fa185aad049ce2/plugins-src/rabbitmq-management/src/rabbit_mgmt_wm_parameter.erl | erlang | compliance with the License. You may obtain a copy of the License at
/
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
--------------------------------------------------------------------
---... | The contents of this file are subject to the Mozilla Public License
Version 1.1 ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ Management Plugin .
The Initial Developer of the Original Code... |
4b71a9b366009c2f9b6e22b52db0bc78eb13a9f5c6eafd18f8223389c57194b7 | roguh/CORE | Main.hs | module Main where
import qualified Data.Text.IO as TIO
import Data.Text as T (unlines, pack, unpack, null)
import Data.List (isPrefixOf, intercalate)
import Control.Monad
import Control.Monad.IO.Class
import System.IO
import System.CPUTime
import System.IO.Error
import System.Environment
import System.Console.Haskel... | null | https://raw.githubusercontent.com/roguh/CORE/1c566ee637b662e7a7e9dea465f62d89eb121fb8/Main.hs | haskell | must add file processing...
_ -> return () | module Main where
import qualified Data.Text.IO as TIO
import Data.Text as T (unlines, pack, unpack, null)
import Data.List (isPrefixOf, intercalate)
import Control.Monad
import Control.Monad.IO.Class
import System.IO
import System.CPUTime
import System.IO.Error
import System.Environment
import System.Console.Haskel... |
6cbf267495bdf4a44855b85e486fa88ba66bde728c8c6dd28c003a849a50e921 | eeng/shevek | db.cljs | (ns shevek.reflow.db
(:refer-clojure :exclude [get get-in])
(:require [reagent.core :as r]
[cljs.pprint :refer [pprint]]))
(defonce ^:private app-db (r/atom {}))
(defn- get-in-db [ks default]
(clojure.core/get-in @app-db ks default))
(defn get-in [ks & [default]]
@(r/track get-in-db ks default))
... | null | https://raw.githubusercontent.com/eeng/shevek/7783b8037303b8dd5f320f35edee3bfbb2b41c02/src/cljs/shevek/reflow/db.cljs | clojure | (ns shevek.reflow.db
(:refer-clojure :exclude [get get-in])
(:require [reagent.core :as r]
[cljs.pprint :refer [pprint]]))
(defonce ^:private app-db (r/atom {}))
(defn- get-in-db [ks default]
(clojure.core/get-in @app-db ks default))
(defn get-in [ks & [default]]
@(r/track get-in-db ks default))
... | |
03c682897d9d7273d61f09b01956e0403169a966922b79986f6f7fb01fe4c6b4 | MinaProtocol/mina | operation_identifier.ml |
* This file has been generated by the OCamlClientCodegen generator for openapi - generator .
*
* Generated by : -generator.tech
*
* Schema Operation_identifier.t : The operation_identifier uniquely identifies an operation within a transaction .
* This file has been generated by the OCamlClientCodegen... | null | https://raw.githubusercontent.com/MinaProtocol/mina/a80b00221953c26ff158e7375a948b5fa9e7bd8b/src/lib/rosetta_models/operation_identifier.ml | ocaml | * The operation_identifier uniquely identifies an operation within a transaction. |
* This file has been generated by the OCamlClientCodegen generator for openapi - generator .
*
* Generated by : -generator.tech
*
* Schema Operation_identifier.t : The operation_identifier uniquely identifies an operation within a transaction .
* This file has been generated by the OCamlClientCodegen... |
98e7a5253d41c0ea1d5c590d44f52a12e3ffd62ed90e08f09a75164da9b3124a | janestreet/ppx_type_directed_value | expand_variant.ml | open Base
open Import
type variant_args =
| Tuple of core_type list * constructor_declaration
| Record of label_declaration list * constructor_declaration
| Poly_variant of core_type list * row_field
type variant_declaration =
{ name : string loc
; args : variant_args
}
let constr_decl_to_varian... | null | https://raw.githubusercontent.com/janestreet/ppx_type_directed_value/f85693cc6d0ad8a9bc3bad55fed22a3d78e1fcaf/src/expand_variant.ml | ocaml | Generates a 'a Variant(T).t for a variant constructor declaration
Generates implementation that calls of_variant on the variant data structure
obtained by calling [generate_impl_variant_item] on [constr_decls]
Generates a variant in Pattern_or_expression.t from a constr_decl,
e.g., [A (c_1, c_2)] or [A { f1 ... | open Base
open Import
type variant_args =
| Tuple of core_type list * constructor_declaration
| Record of label_declaration list * constructor_declaration
| Poly_variant of core_type list * row_field
type variant_declaration =
{ name : string loc
; args : variant_args
}
let constr_decl_to_varian... |
6ad6d3b88b75d1be7a62dba7e6a919d486ec30b9f490a3e247768c8ccb1cc954 | charlieg/Sparser | index-instances.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
copyright ( c ) 1994 -- all rights reserved
;;;
;;; File: "index instances"
;;; Module: "objects;model:categories:"
version : August 1994
initiated 8/9/94 v2.3 from pieces of other files
(in-package :sparser)
;;;-----------------... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/objects/model/categories/index-instances.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER LISP) -*-
File: "index instances"
Module: "objects;model:categories:"
---------------------------------------------------
decoding the index field of a category definition
---------------------------------------------------
the field is a list of keyword... | copyright ( c ) 1994 -- all rights reserved
version : August 1994
initiated 8/9/94 v2.3 from pieces of other files
(in-package :sparser)
(defun decode-index-field (category op-object index-field)
(multiple-value-bind (find-fn index-fn reclaim-fn)
(decode-index-field-aux catego... |
48852ddac438f3577b89460222971b77f62ca3a72f2e1303e7eeb40935f31731 | ArulselvanMadhavan/haskell-first-principles | MonadPlayground.hs | module MonadPlayground where
import Control.Applicative ((*>))
sequencing :: IO ()
sequencing = do
putStrLn "blah"
putStrLn "another thing"
sequencing' :: IO ()
sequencing' = putStrLn "blah" >> putStrLn "another thing"
sequencing'' :: IO ()
sequencing'' = putStrLn "blah" *> putStrLn "another thing"
b... | null | https://raw.githubusercontent.com/ArulselvanMadhavan/haskell-first-principles/06e0c71c502848c8e75c8109dd49c0954d815bba/chapter18/src/MonadPlayground.hs | haskell | module MonadPlayground where
import Control.Applicative ((*>))
sequencing :: IO ()
sequencing = do
putStrLn "blah"
putStrLn "another thing"
sequencing' :: IO ()
sequencing' = putStrLn "blah" >> putStrLn "another thing"
sequencing'' :: IO ()
sequencing'' = putStrLn "blah" *> putStrLn "another thing"
b... | |
0ac89672f585cef0f8c8c13055eabd2332088498b9cb184abe9de6dbbad06e9e | dbuenzli/useri | useri_backend.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/dbuenzli/useri/4646a7b8f3c0d6ce34b1c3f789eebe56cb75b9d2/src-tsdl/useri_backend.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | |
72af30f4d804e9987a76d0313fbad5ca790acc128bd4c5f06bdcd33cc0fad995 | strega-nil/stregaml | Cafec_Containers.ml | module Array = Array
module Mutable_array = Array.Mutable
module String = String
module Spanned = Spanned
module Nfc_string = Nfc_string
module Name = Name
type 'a array = 'a Array.t
type 'a mutable_array = 'a Mutable_array.t
exception Unimplemented [@@deriving_inline sexp]
[@@@end]
| null | https://raw.githubusercontent.com/strega-nil/stregaml/83b51826d5776926fb3f4b7ad03c7ffe837ecbf8/lib/containers/Cafec_Containers.ml | ocaml | module Array = Array
module Mutable_array = Array.Mutable
module String = String
module Spanned = Spanned
module Nfc_string = Nfc_string
module Name = Name
type 'a array = 'a Array.t
type 'a mutable_array = 'a Mutable_array.t
exception Unimplemented [@@deriving_inline sexp]
[@@@end]
| |
afd50f9913e5bf54781c6ff2118ff946e81d343980be58ba2cc42d56bc34dbd7 | axellang/axel | golden_UnitSyntax.hs | module UnitSyntax where
import Axel
import qualified Prelude as AxelRuntime_GHCPrelude
import qualified Axel.Parse.AST as AxelRuntime_AST
import qualified Axel.Sourcemap as AxelRuntime_Sourcemap
main :: () => (IO ())
main = (pure ()) | null | https://raw.githubusercontent.com/axellang/axel/91f323dac411e4932c9fa45da14acdbfff4af910/test/Axel/Test/Transpilation/syntax/golden_UnitSyntax.hs | haskell | module UnitSyntax where
import Axel
import qualified Prelude as AxelRuntime_GHCPrelude
import qualified Axel.Parse.AST as AxelRuntime_AST
import qualified Axel.Sourcemap as AxelRuntime_Sourcemap
main :: () => (IO ())
main = (pure ()) | |
cd99c3cd98cf3acc30a9a1d135c3ec531d7ba06dff19de64e071c29e2e745c01 | dinosaure/facteur | rfc2183.ml | let to_unstrctrd = function
| `Token v -> v
| `String v -> Astring.strf "\"%s\"" v
let content_disposition ?(ty= `Attachment) ?zone ?size ?c_time ?a_time ?m_time filename =
let open Mrmime in
let zone = match zone with
| None ->
let ss = Zone.get () in
let hh, mm = ss / 3600, abs (ss mod 3600 /... | null | https://raw.githubusercontent.com/dinosaure/facteur/d3f27e44107775cc699bfc62b209c2483e3675ac/lib/rfc2183.ml | ocaml | let to_unstrctrd = function
| `Token v -> v
| `String v -> Astring.strf "\"%s\"" v
let content_disposition ?(ty= `Attachment) ?zone ?size ?c_time ?a_time ?m_time filename =
let open Mrmime in
let zone = match zone with
| None ->
let ss = Zone.get () in
let hh, mm = ss / 3600, abs (ss mod 3600 /... | |
00641ffe0f672e41e5900e0e70b6a125b78421468d654d6064beb5327fbd3664 | racket/math | array-constructors.rkt | #lang racket/base
(require typed/untyped-utils)
(require/untyped-contract
(begin (require "array-struct.rkt")
(require "utils.rkt"))
"typed-array-constructors.rkt"
[make-array (All (A) ((Vectorof Integer) A -> (Array A)))]
[axis-index-array ((Vectorof Integer) Integer -> (Array Index))]
[index-ar... | null | https://raw.githubusercontent.com/racket/math/dcd2ea1893dc5b45b26c8312997917a15fcd1c4a/math-lib/math/private/array/array-constructors.rkt | racket | #lang racket/base
(require typed/untyped-utils)
(require/untyped-contract
(begin (require "array-struct.rkt")
(require "utils.rkt"))
"typed-array-constructors.rkt"
[make-array (All (A) ((Vectorof Integer) A -> (Array A)))]
[axis-index-array ((Vectorof Integer) Integer -> (Array Index))]
[index-ar... | |
da5bb6bb321ee9addf51a653c1ea610ccb180b2685d2aa2a6a95ffa1a4c2b7ae | nervous-systems/balonius | sign.clj | (ns ^:no-doc balonius.platform.sign
(:import [javax.crypto Mac]
[javax.crypto.spec SecretKeySpec]
[javax.xml.bind DatatypeConverter]))
(defn- bytes->hex-str [bytes]
(.toLowerCase (DatatypeConverter/printHexBinary bytes)))
(let [HMAC-SHA512 "HmacSHA512"]
(defn hmac-sha512 [s k]
(let [sp... | null | https://raw.githubusercontent.com/nervous-systems/balonius/cf93925f2e0ffe0a76f845194d1949cf1c2626f1/src/balonius/platform/sign.clj | clojure | (ns ^:no-doc balonius.platform.sign
(:import [javax.crypto Mac]
[javax.crypto.spec SecretKeySpec]
[javax.xml.bind DatatypeConverter]))
(defn- bytes->hex-str [bytes]
(.toLowerCase (DatatypeConverter/printHexBinary bytes)))
(let [HMAC-SHA512 "HmacSHA512"]
(defn hmac-sha512 [s k]
(let [sp... | |
f0888e2995ac628e0d01cafdc294ba4ca169ff5c545b0de9166d96946decf84c | sinelaw/xml-to-json-fast | StreamingXmlToJson.hs | module Text.XML.JSON.StreamingXmlToJson(xmlStreamToJSON)
where
import Text.HTML.TagSoup
import qualified Data.Text.Lazy as T
import Data.List (intercalate)
import qualified Data.Foldable
xmlStreamToJSON :: String -> [String]
xmlStreamToJSON fileData = map toText linesWithLevels
where xmlData = parseTags fileDat... | null | https://raw.githubusercontent.com/sinelaw/xml-to-json-fast/59ee90e1e9834304d7148d595fd2edffad638e64/src/Text/XML/JSON/StreamingXmlToJson.hs | haskell | module Text.XML.JSON.StreamingXmlToJson(xmlStreamToJSON)
where
import Text.HTML.TagSoup
import qualified Data.Text.Lazy as T
import Data.List (intercalate)
import qualified Data.Foldable
xmlStreamToJSON :: String -> [String]
xmlStreamToJSON fileData = map toText linesWithLevels
where xmlData = parseTags fileDat... | |
3c9b273954241d41582d5b98f770fc55bbb2ae90030b37162167ceec600afb53 | mejgun/haskell-tdlib | ToggleSessionCanAcceptSecretChats.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.ToggleSessionCanAcceptSecretChats where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
Toggles whether a session can accept incoming secret chats @session_id Session identifier @can_accept_secret_chats... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/9bd82101be6e6218daf816228f6141fe89d97e8b/src/TD/Query/ToggleSessionCanAcceptSecretChats.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
|
| |
module TD.Query.ToggleSessionCanAcceptSecretChats where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
Toggles whether a session can accept incoming secret chats @session_id Session identifier @can_accept_secret_chats Pass true to allow accepring secret chats by... |
44dba68f7ae24286dc2963ed996ed7090c5b481171fe5e425c6d46423bf350d0 | suhailshergill/extensible-effects | Test.hs | # LANGUAGE FlexibleContexts , NoMonomorphismRestriction #
# LANGUAGE TypeOperators , DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Control.Eff.State.Lazy.Test (testGroups) where
import Test.HUnit hiding (State)
import Control.Eff
import Control.Eff.State.Lazy
import Utils
import Te... | null | https://raw.githubusercontent.com/suhailshergill/extensible-effects/249073ccc26f0c49b4bb72cc577d75ef19635f06/test/Control/Eff/State/Lazy/Test.hs | haskell | # LANGUAGE FlexibleContexts , NoMonomorphismRestriction #
# LANGUAGE TypeOperators , DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Control.Eff.State.Lazy.Test (testGroups) where
import Test.HUnit hiding (State)
import Control.Eff
import Control.Eff.State.Lazy
import Utils
import Te... | |
870bf6d7726915bafeaad6e4f58f6606d744cc06b1bf7ecd1469982f3ced442a | binaryage/chromex | cpu.cljs | (ns chromex.ext.system.cpu (:require-macros [chromex.ext.system.cpu :refer [gen-wrap]])
(:require [chromex.core]))
-- functions --------------------------------------------------------------------------------------------------------------
(defn get-info* [config]
(gen-wrap :function ::get-info config))
| null | https://raw.githubusercontent.com/binaryage/chromex/33834ba5dd4f4238a3c51f99caa0416f30c308c5/src/exts/chromex/ext/system/cpu.cljs | clojure | (ns chromex.ext.system.cpu (:require-macros [chromex.ext.system.cpu :refer [gen-wrap]])
(:require [chromex.core]))
-- functions --------------------------------------------------------------------------------------------------------------
(defn get-info* [config]
(gen-wrap :function ::get-info config))
| |
91ef15985808444c69a733eac2e4245ba29fc2c8d593ade24b7bc4c121918aa6 | BranchTaken/Hemlock | test_mapi.ml | open! Basis.Rudiments
open! Basis
open! OrdmapTest
open Ordmap
let test () =
let test arr = begin
let ordmap = of_karray arr in
let ordmap' = mapi ordmap ~f:(fun i (_k, v) ->
String.Fmt.empty |> Uns.pp i |> Fmt.fmt ":" |> Uns.pp v |> Fmt.to_string
) in
let arr' = to_array ordmap' in
File.Fm... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/a21b462fe7f70475591d2ffae185c91552bf6372/bootstrap/test/basis/ordmap/test_mapi.ml | ocaml | open! Basis.Rudiments
open! Basis
open! OrdmapTest
open Ordmap
let test () =
let test arr = begin
let ordmap = of_karray arr in
let ordmap' = mapi ordmap ~f:(fun i (_k, v) ->
String.Fmt.empty |> Uns.pp i |> Fmt.fmt ":" |> Uns.pp v |> Fmt.to_string
) in
let arr' = to_array ordmap' in
File.Fm... | |
2ec977599cf9cde5d02f5478a81baac1fa85b96ec6486e2e6e56b185a875d254 | tcsprojects/pgsolver | prioprom.ml |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* The Priority Promotion Procedure ... | null | https://raw.githubusercontent.com/tcsprojects/pgsolver/b0c31a8b367c405baed961385ad645d52f648325/src/solvers/prioprom.ml | ocaml | msg_tagged 2 (fun _ -> "\n"); |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* The Priority Promotion Procedure ... |
573150afdb1ff2dc06b2b12b142e171f6328074037355b24fc3ea1fc7652b85c | zendesk/clj-headlights | bigtable_io.clj | (ns clj-headlights.bigtable-io
(:require [schema.core :as s]
[clj-headlights.pipeline :as df]
[clj-headlights.clj-fn-call :refer[serializable-function]]
[clj-headlights.pcollections :as pcollections])
(:import (com.google.cloud.bigtable.config BigtableOptions$Builder)
... | null | https://raw.githubusercontent.com/zendesk/clj-headlights/095ab05337c1a35583776a74137041ba9d783383/src/clj_headlights/bigtable_io.clj | clojure | Column Qualifier | (ns clj-headlights.bigtable-io
(:require [schema.core :as s]
[clj-headlights.pipeline :as df]
[clj-headlights.clj-fn-call :refer[serializable-function]]
[clj-headlights.pcollections :as pcollections])
(:import (com.google.cloud.bigtable.config BigtableOptions$Builder)
... |
a724bf60abc751603dd396b4350ef2af6f8f83c9e9e3ab72a6eebbe4332bd3d7 | kadena-io/chainweb-node | InMem.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE BangPatterns #-}
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE NumericUnderscores #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
| A mock in - memory backend t... | null | https://raw.githubusercontent.com/kadena-io/chainweb-node/43e0c9df100a60dcbe071433b5e594cd1242ba58/src/Chainweb/Mempool/InMem.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
* Initialization functions
* Low-level create/destroy functions
----------------------------------------------------------------------------
internal imports
----------------------------------------------------------------------------
-... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE NumericUnderscores #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
| A mock in - memory backend that does not persist to disk .
module Chainweb.Mempool.InMem
(
withInMemoryMempool
, ... |
7d8fed1f45615cba46f755b7e937fa2acae99dd9fa011db9797593212d259774 | footprintanalytics/footprint-web | field_test.clj | (ns metabase.models.field-test
"Tests for specific behavior related to the Field model."
(:require [clojure.test :refer :all]
[metabase.models.database :refer [Database]]
[metabase.models.field :refer [Field]]
[metabase.models.serialization.hash :as serdes.hash]
[meta... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/models/field_test.clj | clojure | (ns metabase.models.field-test
"Tests for specific behavior related to the Field model."
(:require [clojure.test :refer :all]
[metabase.models.database :refer [Database]]
[metabase.models.field :refer [Field]]
[metabase.models.serialization.hash :as serdes.hash]
[meta... | |
1db09571bb97cf3e72623252299f92818a1c06ed40b3126b2d48673978edb329 | metawilm/cl-python | patternmatch.lisp | ;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CLPYTHON.UTIL -*-
;;
This software is Copyright ( c ) Franz Inc. and .
Franz Inc. and grant you the rights to
;; distribute and use this software as governed by the terms
of the Lisp Lesser GNU Public License
;; (),
;; known as the LLGPL.
(in-package :clpython... | null | https://raw.githubusercontent.com/metawilm/cl-python/bce7f80b0c67d3c9f514556f2d14d098efecdde8/util/patternmatch.lisp | lisp | -*- Mode: LISP; Syntax: COMMON-LISP; Package: CLPYTHON.UTIL -*-
distribute and use this software as governed by the terms
(),
known as the LLGPL.
the latter is alist of wildcard-form pairs."
wildcards symbol | This software is Copyright ( c ) Franz Inc. and .
Franz Inc. and grant you the rights to
of the Lisp Lesser GNU Public License
(in-package :clpython.util)
Generic list / symbol pattern matching
( Maybe use CL - Unification at some point )
(defun wildcard-sym-p (x)
(and (symbolp x)
(let ((name ... |
ab09307e06bf55ed96bca9d95f3acb7a16f41cf94a74c0acd3b1776041127cba | pariyatti/kosa | handler.clj | (ns kosa.mobile.today.doha.handler
(:refer-clojure :exclude [list update])
(:require [kosa.mobile.today.doha.db :as db]
[ring.util.response :as resp]))
(defn show-json [req]
(let [card (-> req :params :xt/id db/get)]
(if card
(resp/response card)
(resp/not-found "Doha card not found."... | null | https://raw.githubusercontent.com/pariyatti/kosa/ddf7d339955c3d76cdfde59235aa5dbfdf77db59/src/kosa/mobile/today/doha/handler.clj | clojure | (ns kosa.mobile.today.doha.handler
(:refer-clojure :exclude [list update])
(:require [kosa.mobile.today.doha.db :as db]
[ring.util.response :as resp]))
(defn show-json [req]
(let [card (-> req :params :xt/id db/get)]
(if card
(resp/response card)
(resp/not-found "Doha card not found."... | |
24f0fc20cfb8d7e82d4c37a3ff4f379b90e2cecfe6318c0c35021045a271d2d1 | LexiFi/dead_code_analyzer | bar-fn.ml | open FooFn
let h = f
| null | https://raw.githubusercontent.com/LexiFi/dead_code_analyzer/c44dc2ea5ccb13df2145e9316e21c39f09dad506/examples/bar-fn.ml | ocaml | open FooFn
let h = f
| |
27910ae7fe0403d32c3356b96e7aa33e22f95a7d7b1f9c41d79c036c7755af37 | igorhvr/bedlam | breakpoints.scm | (import hashtable)
(define breakpoints (make-hashtable eqv?))
(define (breakpoint-set? uid)
(hashtable/get breakpoints uid))
(define (set-uid-breakpoint! uid . metadata)
(hashtable/put! breakpoints uid (if (null? metadata) #t
(car metadata))))
(define (clear-breakpoint! ui... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/sisc/sisc-contrib/debugger/breakpoints.scm | scheme | (import hashtable)
(define breakpoints (make-hashtable eqv?))
(define (breakpoint-set? uid)
(hashtable/get breakpoints uid))
(define (set-uid-breakpoint! uid . metadata)
(hashtable/put! breakpoints uid (if (null? metadata) #t
(car metadata))))
(define (clear-breakpoint! ui... | |
7797b889030d2a606e42bf80a01fb63437224b87e0e049c62c2c721813f58136 | SimulaVR/godot-haskell | WebRTCDataChannel.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.WebRTCDataChannel
(Godot.Core.WebRTCDataChannel._STA... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/WebRTCDataChannel.hs | haskell | # NOINLINE bindWebRTCDataChannel_get_ready_state #
# NOINLINE bindWebRTCDataChannel_set_write_mode # | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.WebRTCDataChannel
(Godot.Core.WebRTCDataChannel._STA... |
b1937f8b61e425647ed035315b4b611ec90846ef4c14c9414fa9206c18639eac | berke/aurochs | pffpsf.ml | Pffpsf
let pf = Printf.printf;;
let fp = Printf.fprintf;;
let sf = Printf.sprintf;;
let bf = Printf.bprintf;;
let ef = Printf.eprintf;;
let kf = Printf.kfprintf;;
let ksf = Printf.ksprintf;;
let ipf = Printf.ifprintf;;
| null | https://raw.githubusercontent.com/berke/aurochs/637bdc0d4682772837f9e44112212e7f20ab96ff/util/pffpsf.ml | ocaml | Pffpsf
let pf = Printf.printf;;
let fp = Printf.fprintf;;
let sf = Printf.sprintf;;
let bf = Printf.bprintf;;
let ef = Printf.eprintf;;
let kf = Printf.kfprintf;;
let ksf = Printf.ksprintf;;
let ipf = Printf.ifprintf;;
| |
2def1a5e0394c470045cc444d1875a74722bf2d6d993145fda12b68da823b9be | Opetushallitus/ataru | organization_service_spec.clj | (ns ataru.organization-service.organization-service-spec
(:require [ataru.cache.cache-service :as cache]
[ataru.cache.in-memory-cache :as in-memory]
[ataru.config.core :refer [config]]
[ataru.organization-service.organization-client :as organization-client]
[ataru.organ... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/2d8ef1d3f972621e301a3818567d4e11219d2e82/spec/ataru/organization_service/organization_service_spec.clj | clojure | hierarchies cache
groups cache | (ns ataru.organization-service.organization-service-spec
(:require [ataru.cache.cache-service :as cache]
[ataru.cache.in-memory-cache :as in-memory]
[ataru.config.core :refer [config]]
[ataru.organization-service.organization-client :as organization-client]
[ataru.organ... |
08ee32c8831a803accf3c8b835d15da4444f6f7cabec8162f5ffae078c96aee4 | synduce/Synduce | parity_of_last.ml | type 'a list = Elt of 'a | Cons of 'a * 'a list
let rec even_list = function Elt x -> x mod 2 = 0 | Cons (hd, tl) -> hd mod 2 = 0 && even_list tl
let rec spec = function Elt x -> x mod 2 | Cons (a, l) -> spec l
let rec target = function Elt x -> [%synt s0] | Cons (a, l) -> [%synt f0] [@@requires even_list]
| null | https://raw.githubusercontent.com/synduce/Synduce/d453b04cfb507395908a270b1906f5ac34298d29/benchmarks/constraints/evenlist/parity_of_last.ml | ocaml | type 'a list = Elt of 'a | Cons of 'a * 'a list
let rec even_list = function Elt x -> x mod 2 = 0 | Cons (hd, tl) -> hd mod 2 = 0 && even_list tl
let rec spec = function Elt x -> x mod 2 | Cons (a, l) -> spec l
let rec target = function Elt x -> [%synt s0] | Cons (a, l) -> [%synt f0] [@@requires even_list]
| |
fe758f146f2b314d05088f2680ab411101121534b3e8cb2f3cd0145b7526ff93 | thosmos/riverdb | devicetype.cljc | (ns riverdb.rad.model.devicetype
(:require
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.rad.attributes :as attr :refer [defattr]]
[com.fulcrologic.rad.attributes-options :as ao]
[com.fulcrologic.rad.authorization :as auth]
[com.fulcrologic.rad.form :as form]
#?(... | null | https://raw.githubusercontent.com/thosmos/riverdb/db4567b7eb957d9ee668525c8f48133421dd53e2/src/rad/riverdb/rad/model/devicetype.cljc | clojure | (ns riverdb.rad.model.devicetype
(:require
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.rad.attributes :as attr :refer [defattr]]
[com.fulcrologic.rad.attributes-options :as ao]
[com.fulcrologic.rad.authorization :as auth]
[com.fulcrologic.rad.form :as form]
#?(... | |
6ffc1391812ec5f163bdb8c8ab8a835a84b4fb11d655162249fc7e2781a0203d | chameco/bramble | Error.hs | module Bramble.Utility.Error where
import Control.Exception.Safe (Exception, displayException)
import Data.Monoid (mconcat)
import Data.Function (($))
import Data.Int (Int)
import Data.Text (Text, pack, unpack)
import Text.Show (Show, show)
data TypeError
= UnboundIndex Int
| UnknownIdentifier Text
| IllegalA... | null | https://raw.githubusercontent.com/chameco/bramble/938b1da0e0fcd8bf9502c10905412acc0773bfb9/src/Bramble/Utility/Error.hs | haskell | module Bramble.Utility.Error where
import Control.Exception.Safe (Exception, displayException)
import Data.Monoid (mconcat)
import Data.Function (($))
import Data.Int (Int)
import Data.Text (Text, pack, unpack)
import Text.Show (Show, show)
data TypeError
= UnboundIndex Int
| UnknownIdentifier Text
| IllegalA... | |
a3917f721871c9b6ac74b313d8a644847262dc1079dd9ff27566dd0afa1efe7d | bendoerr/real-world-haskell | NewtypeDiff.hs | -- ok: any number of fields and constructors
data TwoFields = TwoFields Int Int
ok : just one field
newtype Okay = ExactlyOne Int
-- ok: type params are no problem
newtype Param a b = Param (Either a b)
-- ok: record syntax is fine
newtype Record = Record {
getInt :: Int
}
-- bad: no fields
-- newtype TooFew ... | null | https://raw.githubusercontent.com/bendoerr/real-world-haskell/fa43aa59e42a162f5d2d5655b274b964ebeb8f0a/ch06/NewtypeDiff.hs | haskell | ok: any number of fields and constructors
ok: type params are no problem
ok: record syntax is fine
bad: no fields
newtype TooFew = TooFew
bad: too many constructors
newtype TooManyConstructors = This
| That | data TwoFields = TwoFields Int Int
ok : just one field
newtype Okay = ExactlyOne Int
newtype Param a b = Param (Either a b)
newtype Record = Record {
getInt :: Int
}
bad : more than one field
newtype
|
88a23eecdc95f310906b54a7cb5d8a8bc017d554ddf76575b89953c3e0db9130 | aphyr/timelike | scheduler.clj | (ns timelike.scheduler
(:refer-clojure :exclude [time future])
(:use [clojure.stacktrace :only [print-cause-trace]]
clojure.set)
(:import (java.util.concurrent ConcurrentSkipListSet
CountDownLatch)))
Time
;
; The current virtual time is available from the (time) functi... | null | https://raw.githubusercontent.com/aphyr/timelike/e802908595bb28d02575985c48bf79533b4294f1/src/timelike/scheduler.clj | clojure |
The current virtual time is available from the (time) function. Calling
scheduler ensures that memory side effects will proceed in order.
Concurrency
Only when all (virtual) threads have blocked may sleeping threads be awakened
to proceed. At that time, the clock advances to the next scheduled time and
awakens... | (ns timelike.scheduler
(:refer-clojure :exclude [time future])
(:use [clojure.stacktrace :only [print-cause-trace]]
clojure.set)
(:import (java.util.concurrent ConcurrentSkipListSet
CountDownLatch)))
Time
( sleep n ) sleeps for n seconds . No virtual time elapses oth... |
4842ee30b413d5f1bffd7528ff12b80c6339c3d131201271adc3771a09f8353c | apauley/hledger-flow | Unit.hs | # LANGUAGE QuasiQuotes #
module PathHelpers.Unit where
import Test.HUnit
import Path
import Hledger.Flow.PathHelpers
testPathSize :: Test
testPathSize = TestCase (
do
let d0 = [reldir|.|]
let d1 = [reldir|d1|]
let d1ond0 = d0 </> [reldir|d1|]
let d2 = d1 </> [reldir|d2|]
let d3 = d2 </> [reldir... | null | https://raw.githubusercontent.com/apauley/hledger-flow/b1d86dbd111cbacbace769fb4d4596b647951fc7/test/PathHelpers/Unit.hs | haskell | # LANGUAGE QuasiQuotes #
module PathHelpers.Unit where
import Test.HUnit
import Path
import Hledger.Flow.PathHelpers
testPathSize :: Test
testPathSize = TestCase (
do
let d0 = [reldir|.|]
let d1 = [reldir|d1|]
let d1ond0 = d0 </> [reldir|d1|]
let d2 = d1 </> [reldir|d2|]
let d3 = d2 </> [reldir... | |
ab1f1e14ceb04097d0a0f50a7e2ba7072f51b939c3b972f0ed0f8fbff97e9b4c | ghc/packages-Cabal | Setup.hs | import Distribution.Simple
main = defaultMain >> writeFile "marker" "ok"
| null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-install/tests/IntegrationTests2/build/setup-custom1/Setup.hs | haskell | import Distribution.Simple
main = defaultMain >> writeFile "marker" "ok"
| |
8ae481b6f87eb2e134a422f1871099f8850687785f925c5512756f1d85de8be3 | Clozure/ccl | ppc32-bignum.lisp | -*- Mode : Lisp ; Package : CCL -*-
;;;
Copyright 1994 - 2009 Clozure Associates
;;;
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 appl... | null | https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/level-0/PPC/PPC32/ppc32-bignum.lisp | lisp | Package : CCL -*-
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 la... | Copyright 1994 - 2009 Clozure Associates
distributed under the License is distributed on an " AS IS " BASIS ,
(in-package "CCL")
(eval-when (:compile-toplevel :execute)
(require "PPC32-ARCH")
(require "PPC-LAPMACROS")
Set RES to 1 if ( u < x y ) , to 0 otherwise .
(defppclapmacro sltu (res x y)
`(pr... |
bc9b3da18ca5f31a71982555102833ab00ff961f2a6ae8d2fbd36aa24344836e | thlack/surfs | examples_test.clj | (ns thlack.surfs.examples-test
"Way less cool unit test suite, but it's useful for seeing surfs
in action :)"
(:require [clojure.test :refer [is]]
[thlack.surfs :refer [defc]]
[thlack.surfs.test-utils :refer [defrendertest]]))
;;; Composition
(defrendertest text
[:text "Hello"]
[:t... | null | https://raw.githubusercontent.com/thlack/surfs/e03d137d6d43c4b73a45a71984cf084d2904c4b0/test/thlack/surfs/examples_test.clj | clojure | Composition
Elements
Blocks
Views
Messages
Custom components
Misc | (ns thlack.surfs.examples-test
"Way less cool unit test suite, but it's useful for seeing surfs
in action :)"
(:require [clojure.test :refer [is]]
[thlack.surfs :refer [defc]]
[thlack.surfs.test-utils :refer [defrendertest]]))
(defrendertest text
[:text "Hello"]
[:text {:type :mrkd... |
414c55e60203ac59b9d25617089d2103631e1c714a0f981ce454b589ba0ae284 | ml4tp/tcoq | nameops.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/library/nameops.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Identifiers
ident made of _ and d... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pp
open Util
open Names
... |
b2f2c3c1dec79f34534ed09f2b894a2579c49c288f504bfa364394ecb309be9e | shortishly/pgmp | pgmp_rep_log_ets.erl | Copyright ( c ) 2022 < >
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distributed under... | null | https://raw.githubusercontent.com/shortishly/pgmp/39da98ac0eb313dfce52cc735df0d3003afc2f15/src/pgmp_rep_log_ets.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissi... | Copyright ( c ) 2022 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(pgmp_rep_log_ets).
-behaviour(pgmp_rep_log).
-export([begin_transaction/1]).
-export([callback_mode/0]).
-export([commit/1]).
-export([... |
3a90d906b3948d7c478ddf4adc8edb8e9a272228703a736103e384a9cb1ef568 | processone/ejabberd-contrib | mod_shcommands.erl | %%%----------------------------------------------------------------------
%%% File : mod_shcommands.erl
Author : < >
%%% Purpose : Execute shell commands
Created : 1 Sep 2007 by >
I d : $ I d : mod_shcommands.erl 1034 2009 - 11 - 17 21:44:17Z badlop $
%%%-------------------------------------------... | null | https://raw.githubusercontent.com/processone/ejabberd-contrib/e76b0877d6281e9e23984bd5e946bf43091875b8/mod_shcommands/src/mod_shcommands.erl | erlang | ----------------------------------------------------------------------
File : mod_shcommands.erl
Purpose : Execute shell commands
----------------------------------------------------------------------
-------------------
gen_mod functions
-------------------
-------------------
Commands
-------------------
-----... | Author : < >
Created : 1 Sep 2007 by >
I d : $ I d : mod_shcommands.erl 1034 2009 - 11 - 17 21:44:17Z badlop $
-module(mod_shcommands).
-author('').
-behaviour(gen_mod).
-export([start/2, stop/1, depends/2, mod_options/1, mod_doc/0, mod_status/0]).
-export([execute_system/1, execute_erlang/1]).
-e... |
bc3a8260d8973349e22cae60c53fd4caabe120d4c82f4b2aae5b76254da287ad | khibino/haskell-relational-record | QueryArrowExample.hs | {-# LANGUAGE Arrows #-}
# LANGUAGE FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , DataKinds , DeriveGeneric #
# LANGUAGE TemplateHaskell #
module QueryArrowExample where
import GHC.Generics (Generic)
import Data.Functor.ProductIsomorphic
import Database.Record
import Database.Relational.Arrow
import ... | null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/examples/HDBC/PostgreSQL/example/1/QueryArrowExample.hs | haskell | # LANGUAGE Arrows #
Direct join style
Nested arrow
Aggregation
Good scope check of arrow when nested case
bad line -- not in scope error of ` u '
bad line -- not in scope error of `u'
Relation making placeholder
Placeholder propagation
Window funcions
Composed Key
Composed value | # LANGUAGE FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , DataKinds , DeriveGeneric #
# LANGUAGE TemplateHaskell #
module QueryArrowExample where
import GHC.Generics (Generic)
import Data.Functor.ProductIsomorphic
import Database.Record
import Database.Relational.Arrow
import Database.HDBC.Query.TH (... |
199f714a5ace3e7410df1bce1e1ffb4c9cc94d058ae2586499d1a52f6bee5b24 | vereis/jarlang | nnbottles.erl | -module(nnbottles).
-export([sing/0, pluralise/2]).
sing() ->
sing(99).
sing(N) when N < 0 ->
done;
sing(N) ->
verseone(N),
versetwo(N-1),
sing(N-1).
verseone(N) ->
Bot = pluralise("bottle", N),
io:format("~s ~s of beer on the wall, ~s ~s of beer~n", [count(N), Bot, count(N), Bot]).
vers... | null | https://raw.githubusercontent.com/vereis/jarlang/72105b79c1861aa6c4f51c3b50ba695338aafba4/doc/example_manual_translation/nnbottles.erl | erlang | -module(nnbottles).
-export([sing/0, pluralise/2]).
sing() ->
sing(99).
sing(N) when N < 0 ->
done;
sing(N) ->
verseone(N),
versetwo(N-1),
sing(N-1).
verseone(N) ->
Bot = pluralise("bottle", N),
io:format("~s ~s of beer on the wall, ~s ~s of beer~n", [count(N), Bot, count(N), Bot]).
vers... | |
d091e904ff14532fb0a656c35ca9dcbeeb3e9be3fae1ecca446c247b2d7f93e4 | langston-barrett/CoverTranslator | Main.hs | module Main where
import Property
data T = L | B T T
Used in original code
type String' = [C]
------------------------------------------------------------
-- Stuff related to +++, our rewrite of ++.
infixr 5 +++
(+++) :: [a] -> [a] -> [a]
[] +++ ys = ys
(x:xs) +++ ys = x : (xs +++ ys)
-- These need separate... | null | https://raw.githubusercontent.com/langston-barrett/CoverTranslator/4172bef9f4eede7e45dc002a70bf8c6dd9a56b5c/examples/data-conversion/Main.hs | haskell | ----------------------------------------------------------
Stuff related to +++, our rewrite of ++.
These need separate proofs
Proof using guarded coinduction is tricky to express.
Proof using fixpoint induction:
P(a) = (a xs [] = xs)
Base: P(bottom)
Step: P(a) => P(app a) where app a [] ys = ys
... | module Main where
import Property
data T = L | B T T
Used in original code
type String' = [C]
infixr 5 +++
(+++) :: [a] -> [a] -> [a]
[] +++ ys = ys
(x:xs) +++ ys = x : (xs +++ ys)
prop_append_nil = forAll (\xs -> ( xs +++ [] ) === xs)
Both cases require three different cases ( _ | _ , [ ] , : . )
... |
68ecfc563e5f9408f97629d3e8cc39829cf3c8b88f2cdd102f1a424bb3e29daa | reagent-project/reagent-cookbook | core.cljs | (ns highcharts.core
(:require
[reagent.dom :as rdom]
[reagent.core :as reagent]))
(def chart-config
{:chart {:type "bar"}
:title {:text "Historic World Population by Region"}
:subtitle {:text "Source: Wikipedia.org"}
:xAxis {:categories ["Africa" "America" "Asia" "Europe" "Oceania"]
... | null | https://raw.githubusercontent.com/reagent-project/reagent-cookbook/ccda91a74377098d27e2707c306a0187243cb290/recipes/highcharts/src/cljs/highcharts/core.cljs | clojure | (ns highcharts.core
(:require
[reagent.dom :as rdom]
[reagent.core :as reagent]))
(def chart-config
{:chart {:type "bar"}
:title {:text "Historic World Population by Region"}
:subtitle {:text "Source: Wikipedia.org"}
:xAxis {:categories ["Africa" "America" "Asia" "Europe" "Oceania"]
... | |
f2f67610c886daa4ea7ff8106a6a625695e6a9e53bed114ab99b2b50ab73ed34 | nstack/nstack | ConfigFile.hs | # OPTIONS_GHC -fno - warn - orphans #
module NStack.Module.ConfigFile where
import Control.Applicative ((<|>))
import Control.Monad
mtl
mtl
import Data.Aeson.Types (typeMismatch)
import Data.Text(Text, unpack, pack, toLower)
import qualified Data.Yaml as Y
import Data.Yaml((.:), (.:?), (.!=), (.=))
import Data.St... | null | https://raw.githubusercontent.com/nstack/nstack/c987557511134ed61db152a0bccbb80216b07a4b/nstack/src/NStack/Module/ConfigFile.hs | haskell | | ConfigFile module configuration file used to describe the module project dir
^ the name of the module - I think we can remove this as is also specified within the module.nml
^ We can define the parent either in terms of the stack, which then resolves to a known-parent, or reference a parent (i.e. Framework) direct... | # OPTIONS_GHC -fno - warn - orphans #
module NStack.Module.ConfigFile where
import Control.Applicative ((<|>))
import Control.Monad
mtl
mtl
import Data.Aeson.Types (typeMismatch)
import Data.Text(Text, unpack, pack, toLower)
import qualified Data.Yaml as Y
import Data.Yaml((.:), (.:?), (.!=), (.=))
import Data.St... |
d194f3233c7102c717acfc6cdd74efd6457dd7036d81d68a548dc959bb153c2c | nikita-volkov/ptr | ByteString.hs | module Ptr.ByteString where
import qualified Data.ByteString.Internal as B
import qualified Ptr.Parse as C
import qualified Ptr.Peek as D
import qualified Ptr.Poking as A
import Ptr.Prelude
# INLINE poking #
poking :: A.Poking -> B.ByteString
poking (A.Poking size population) =
B.unsafeCreate size population
# INL... | null | https://raw.githubusercontent.com/nikita-volkov/ptr/82e1f3ef67e5b1c6d3803a8f19c3ef1b5bd8d181/library/Ptr/ByteString.hs | haskell | # SCC "parse" #
# SCC "peek" # | module Ptr.ByteString where
import qualified Data.ByteString.Internal as B
import qualified Ptr.Parse as C
import qualified Ptr.Peek as D
import qualified Ptr.Poking as A
import Ptr.Prelude
# INLINE poking #
poking :: A.Poking -> B.ByteString
poking (A.Poking size population) =
B.unsafeCreate size population
# INL... |
5f8a8dee88a18d018122960ff3646a84c3ae05b270767d89a025239ff328066b | ananthakumaran/webify | EOT.hs | module EOT(
generate
) where
import Control.Monad
import Data.Binary.Put
import Data.Bits
import qualified Data.ByteString as B
import Data.List (find)
import Data.Maybe (fromJust, isJust)
import Data.Text.Encoding (encodeUtf16LE)
import... | null | https://raw.githubusercontent.com/ananthakumaran/webify/e73fa2e3aa01512fe735dbf00a81e5909ccabbc9/src/EOT.hs | haskell | font size
flags | module EOT(
generate
) where
import Control.Monad
import Data.Binary.Put
import Data.Bits
import qualified Data.ByteString as B
import Data.List (find)
import Data.Maybe (fromJust, isJust)
import Data.Text.Encoding (encodeUtf16LE)
import... |
161dca8e540aa2afa5c019d92e0548db8348ab4d676e02e15d4cc8b1c634f3d0 | snmsts/cl-langserver | slynk-util.lisp | ;;; slynk-util.lisp --- stuff of questionable utility
;;
;; License: public domain
(in-package :ls-base)
(defmacro do-symbols* ((var &optional (package '*package*) result-form)
&body body)
"Just like do-symbols, but makes sure a symbol is visited only once."
(let ((seen-ht (gensym "SEEN-HT"... | null | https://raw.githubusercontent.com/snmsts/cl-langserver/3b1246a5d0bd58459e7a64708f820bf718cf7175/src/helitage/slynk-util.lisp | lisp | slynk-util.lisp --- stuff of questionable utility
License: public domain |
(in-package :ls-base)
(defmacro do-symbols* ((var &optional (package '*package*) result-form)
&body body)
"Just like do-symbols, but makes sure a symbol is visited only once."
(let ((seen-ht (gensym "SEEN-HT")))
`(let ((,seen-ht (make-hash-table :test #'eq)))
(do-symbols (,var ,p... |
7422ed95bf158d1a39782bac06045d07604bb4fed4c5e42872543ce6eaff629e | SimulaVR/godot-haskell | Line2D.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.Line2D
(Godot.Core.Line2D._LINE_JOINT_ROUND,
... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/Line2D.hs | haskell | | Adds a point at the @position@. Appends the point at the end of the line.
| Adds a point at the @position@. Appends the point at the end of the line.
| Removes all points from the line.
| Removes all points from the line.
# NOINLINE bindLine2D_get_curve #
| The line's width varies with the curve. The original wi... | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.Line2D
(Godot.Core.Line2D._LINE_JOINT_ROUND,
... |
fdd99fa5410196db9b491fabfdffe6a5b00fcfb2222a326367cf45f4706103b9 | freckle/stackctl | Format.hs | module Stackctl.Spec.Changes.Format
( Format(..)
, formatOption
, OmitFull(..)
, omitFullOption
, formatChangeSet
, formatRemovedStack
, formatTTY
) where
import Stackctl.Prelude
import qualified Data.List.NonEmpty as NE
import qualified Data.Text as T
import Options.Applicative hiding (action)
import... | null | https://raw.githubusercontent.com/freckle/stackctl/fdb99c911dd118dee4a46358da98ceedcebc2e09/src/Stackctl/Spec/Changes/Format.hs | haskell | brittany-disable-next-binding | module Stackctl.Spec.Changes.Format
( Format(..)
, formatOption
, OmitFull(..)
, omitFullOption
, formatChangeSet
, formatRemovedStack
, formatTTY
) where
import Stackctl.Prelude
import qualified Data.List.NonEmpty as NE
import qualified Data.Text as T
import Options.Applicative hiding (action)
import... |
29df45c4246cefd2e782d16574b387002b50cfe248949ca15301b7558834da82 | hoelzl/Clicc | packg.lisp | ;;;-----------------------------------------------------------------------------
Copyright ( C ) 1993 Christian - Albrechts - Universitaet zu Kiel , Germany
;;;-----------------------------------------------------------------------------
Projekt : APPLY - A Practicable And Portable Lisp Implementation
;;; ... | null | https://raw.githubusercontent.com/hoelzl/Clicc/cea01db35301144967dc74fd2f96dd58aa52d6ea/src/runtime/lisp/packg.lisp | lisp | -----------------------------------------------------------------------------
-----------------------------------------------------------------------------
------------------------------------------------------
- Definition von PACKAGE als LISP-Struktur
- alle Package-Funktionen
... | Copyright ( C ) 1993 Christian - Albrechts - Universitaet zu Kiel , Germany
Projekt : APPLY - A Practicable And Portable Lisp Implementation
Funktion : Laufzeitsystem
$ Revision : 1.17 $
Revision 1.17 1994/06/02 13:20:18 hk
Print - Funktion f"ur package - .
set - symbol - package statt ( setf... |
4c709262063e6ac094a964cadbacb03215f2ec9343de618074eb703a8286613d | S8A/htdp-exercises | ex293.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex293) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex293.rkt | racket | about the language level of this file in a form that our tools can easily process.
X [List-of X] -> [Maybe [List-of X]]
with x, #false otherwise
X [List-of X] -> [ [Maybe [List-of X]] -> Boolean ]
is l0 a subset of l that starts with x, or #false
is l0 a sublist of l | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex293) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
returns the first sublist of l that starts
(define (f... |
e15ae22d2ce69062ee7104d730decec31b83118b548260489717f9f4777ee80f | axellang/axel | golden_RecordSyntax.hs | module RecordSyntax where
import Axel
import qualified Prelude as AxelRuntime_GHCPrelude
import qualified Axel.Parse.AST as AxelRuntime_AST
import qualified Axel.Sourcemap as AxelRuntime_Sourcemap
data Foo = Foo {fooaXEL_SYMBOL_CARET_ :: Int,bar :: String} deriving ()
foo :: () => Foo
foo = (Foo {fooaXEL_SYMBOL_CARET_... | null | https://raw.githubusercontent.com/axellang/axel/91f323dac411e4932c9fa45da14acdbfff4af910/test/Axel/Test/Transpilation/syntax/golden_RecordSyntax.hs | haskell | module RecordSyntax where
import Axel
import qualified Prelude as AxelRuntime_GHCPrelude
import qualified Axel.Parse.AST as AxelRuntime_AST
import qualified Axel.Sourcemap as AxelRuntime_Sourcemap
data Foo = Foo {fooaXEL_SYMBOL_CARET_ :: Int,bar :: String} deriving ()
foo :: () => Foo
foo = (Foo {fooaXEL_SYMBOL_CARET_... | |
6612c677ed13a70d016da56e6f4c2ee0022838aeeb2d0690de1ac9ed8e18db33 | Ptival/language-ocaml | Type.hs | # LANGUAGE DuplicateRecordFields #
# LANGUAGE RecordWildCards #
module Language.OCaml.Definitions.Parsing.ASTHelper.Type
( ConstructorOpts (..),
FieldOpts (..),
MkOpts (..),
constructor,
field,
mk,
)
where
import Data.Default (Default (..))
import Language.OCaml.Definitions.Parsing.ASTHelper.C... | null | https://raw.githubusercontent.com/Ptival/language-ocaml/7b07fd3cc466bb2ad2cac4bfe3099505cb63a4f4/lib/Language/OCaml/Definitions/Parsing/ASTHelper/Type.hs | haskell | # LANGUAGE DuplicateRecordFields #
# LANGUAGE RecordWildCards #
module Language.OCaml.Definitions.Parsing.ASTHelper.Type
( ConstructorOpts (..),
FieldOpts (..),
MkOpts (..),
constructor,
field,
mk,
)
where
import Data.Default (Default (..))
import Language.OCaml.Definitions.Parsing.ASTHelper.C... | |
791913149074fbd33104ba2c6d60d2cc46ef790060ffe581e84cb4792c2e663f | r0man/netcdf-clj | time_test.clj | (ns netcdf.time-test
(:import java.sql.Timestamp)
(:use [clj-time.core :only (date-time)]
netcdf.time
clojure.test))
(deftest test-date-path-fragment
(is (nil? (date-path-fragment nil)))
(is (= "2011/02/04" (date-path-fragment (date-time 2011 2 4))))
(is (= "2011/02/04" (date-path-fragment "2... | null | https://raw.githubusercontent.com/r0man/netcdf-clj/90f40ab958d3ebc16a4fcfc882c9cd7ef469d054/test/netcdf/time_test.clj | clojure | (ns netcdf.time-test
(:import java.sql.Timestamp)
(:use [clj-time.core :only (date-time)]
netcdf.time
clojure.test))
(deftest test-date-path-fragment
(is (nil? (date-path-fragment nil)))
(is (= "2011/02/04" (date-path-fragment (date-time 2011 2 4))))
(is (= "2011/02/04" (date-path-fragment "2... | |
3d51b8aecd7fad375e55391d5a9b4271adb86708e4ea7c80de08cd05facaf443 | namenu/advent-of-code | day22.clj | (ns aoc.year2018.day22
(:require [aoc.util :refer [range-incl manhattan-dist]]
[aoc.graph :refer [simple-A*]]))
( def depth 510 )
( def target [ 10 10 ] )
(def depth 3066)
(def target [13 726])
(def upper-bound (* 2 (dec (manhattan-dist [0 0] target))))
(def erosion
(memoize
(fn [[x y]]
(l... | null | https://raw.githubusercontent.com/namenu/advent-of-code/83f8cf05931f814dab76696bf46fec1bb1276fac/2018/clojure/src/aoc/year2018/day22.clj | clojure | (ns aoc.year2018.day22
(:require [aoc.util :refer [range-incl manhattan-dist]]
[aoc.graph :refer [simple-A*]]))
( def depth 510 )
( def target [ 10 10 ] )
(def depth 3066)
(def target [13 726])
(def upper-bound (* 2 (dec (manhattan-dist [0 0] target))))
(def erosion
(memoize
(fn [[x y]]
(l... | |
acbaead4d3d790f15df1d40bd2f312bab8e48a25b92d865133323ecebb1446ec | broom-lang/broom | PIso.ml | type ('a, 'b) t = {apply : 'a -> 'b option; unapply : 'b -> 'a option}
let apply {apply; _} = apply
let unapply {unapply; _} = unapply
let piso apply unapply = {apply; unapply}
let iso apply unapply = piso (fun x -> Some (apply x)) (fun x -> Some (unapply x))
let prism apply unapply = piso (fun x -> Some (apply x)) u... | null | https://raw.githubusercontent.com/broom-lang/broom/8a2803968bb799248c5f7182942fe7bbc85a9633/compiler/lib/Util/PIso.ml | ocaml | HACK | type ('a, 'b) t = {apply : 'a -> 'b option; unapply : 'b -> 'a option}
let apply {apply; _} = apply
let unapply {unapply; _} = unapply
let piso apply unapply = {apply; unapply}
let iso apply unapply = piso (fun x -> Some (apply x)) (fun x -> Some (unapply x))
let prism apply unapply = piso (fun x -> Some (apply x)) u... |
f277dbeb6c53c7df647ce8c61a517aa6c33ab857fce13bb3cc2c70fdb463ba04 | CardanoSolutions/kupo | Prelude.hs | # LANGUAGE AllowAmbiguousTypes #
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
module Kupo.Prelude
( -- * relude
module Relude
-- * JSON
, FromJSON (..)
, ToJSO... | null | https://raw.githubusercontent.com/CardanoSolutions/kupo/a03d574ce2e1f22bb36a11993aba328b65523c99/src/Kupo/Prelude.hs | haskell | * relude
* JSON
* Lenses
* Extras
* Encoding / Decoding
* Serialization
* Crypto
* System
JSON
| Generic JSON encoding, with pre-defined default options.
Extras
| Remove duplicates from a list based on information extracted from the
elements.
| Like 'foldr' but provides access to the index of each ele... | # LANGUAGE AllowAmbiguousTypes #
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
module Kupo.Prelude
module Relude
, FromJSON (..)
, ToJSON (..)
, encodingToValue
,... |
e78699a0ed87a47e38d5d52d0c256f21c48a8d4cb97bd315dfb8afda67087b9d | dcastro/haskell-flatbuffers | FlatBuffers.hs | module FlatBuffers
(
* TemplateHaskell
TH.mkFlatBuffers
, TH.defaultOptions
, TH.Options(..)
-- * Creating a flatbuffer
, W.encode
, W.encodeWithFileIdentifier
, W.none
-- * Reading a flatbuffer
, R.decode
, R.checkFileIdentifier
-- * File Identifier
, FI.FileIdentifier
, FI.HasFi... | null | https://raw.githubusercontent.com/dcastro/haskell-flatbuffers/cea6a75109de109ae906741ee73cbb0f356a8e0d/src/FlatBuffers.hs | haskell | * Creating a flatbuffer
* Reading a flatbuffer
* File Identifier
* Types | module FlatBuffers
(
* TemplateHaskell
TH.mkFlatBuffers
, TH.defaultOptions
, TH.Options(..)
, W.encode
, W.encodeWithFileIdentifier
, W.none
, R.decode
, R.checkFileIdentifier
, FI.FileIdentifier
, FI.HasFileIdentifier(..)
, W.WriteStruct
, W.WriteTable
, W.WriteUnion
, R.Struct
... |
5bfed16a367513d69cd9ae85edaeba26d50e6fe109dbad80ba6710721a1ddd41 | manuel-serrano/bigloo | external.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / recette / external.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation : ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/recette/external.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
*=====================================================================*/
*---------------------------... | * serrano / prgm / project / bigloo / recette / external.scm * /
* Author : * /
* Creation : Fri Aug 25 11:52:25 2000 * /
* Last change : Thu Sep 18 11:03:34 2008 ( serrano ) * /
* Copyri... |
5556df20172df1124c16c8765bf9a41bcb34e87da069954be2496cbd61b212d5 | ryanpbrewster/haskell | set_intersection.hs | set_intersection.hs
- Challenge Description :
-
- You are given two sorted list of numbers ( ascending order ) . The lists
- themselves are comma delimited and the two lists are semicolon delimited .
- Print out the intersection of these two sets .
- Input sample :
-
- File containing two list... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/CodeEval/set_intersection.hs | haskell | Data.List defines `intersect` already
alternately | set_intersection.hs
- Challenge Description :
-
- You are given two sorted list of numbers ( ascending order ) . The lists
- themselves are comma delimited and the two lists are semicolon delimited .
- Print out the intersection of these two sets .
- Input sample :
-
- File containing two list... |
3b0f5829ce5789c8ef9d2257786264edf6711c9ee1dc74234cea03857c4890f3 | Bannerets/camlproto | SecureRand.ml | open! Base
let () = Nocrypto_entropy_unix.initialize ()
let rand_cs size = Nocrypto.Rng.generate size
| null | https://raw.githubusercontent.com/Bannerets/camlproto/0b31083b8c0103079ec2881176f63f8cb12abb73/src/platform/caml/SecureRand.ml | ocaml | open! Base
let () = Nocrypto_entropy_unix.initialize ()
let rand_cs size = Nocrypto.Rng.generate size
| |
40cc2f6c06f2f8c54361d0cea25f50d17af5906a384afaff1f2e57ce2fbbe890 | wilbowma/cur | pair.rkt | #lang s-exp "../main.rkt"
(provide prod pair fst snd fst* snd* (for-syntax ~prod pair))
(require cur/stdlib/sugar)
(define-datatype prod [X : Type] [Y : Type] : Type
[pair* X Y])
(define-implicit pair = pair* 2)
(define/rec/match fst* : [X : Type] [Y : Type] (prod X Y) -> X
[(pair x _) => x]
#:type-aliases (... | null | https://raw.githubusercontent.com/wilbowma/cur/e039c98941b3d272c6e462387df22846e10b0128/cur-lib/cur/stdlib/pair.rkt | racket | #lang s-exp "../main.rkt"
(provide prod pair fst snd fst* snd* (for-syntax ~prod pair))
(require cur/stdlib/sugar)
(define-datatype prod [X : Type] [Y : Type] : Type
[pair* X Y])
(define-implicit pair = pair* 2)
(define/rec/match fst* : [X : Type] [Y : Type] (prod X Y) -> X
[(pair x _) => x]
#:type-aliases (... | |
ea77ae184d44696bad493d39f84f12f0cb04fd29821e97dd6ed4109d820071b8 | MarchLiu/market | seq_test.clj | (ns liu.mars.market.seq-test
(:require [liu.mars.market.seq :refer :all])
(:require [clojure.test :refer :all]))
(testing "sequences functions should list"
(testing "list a empty sequences list"
(is (empty? (list-seq))))
(testing "create a new sequence and use it and then drop it"
(create-seq "test")
... | null | https://raw.githubusercontent.com/MarchLiu/market/7a7daf6c04b41e0f8494be6740da8d54785c5e77/sequences/src/test/clojure/liu/mars/market/seq_test.clj | clojure | (ns liu.mars.market.seq-test
(:require [liu.mars.market.seq :refer :all])
(:require [clojure.test :refer :all]))
(testing "sequences functions should list"
(testing "list a empty sequences list"
(is (empty? (list-seq))))
(testing "create a new sequence and use it and then drop it"
(create-seq "test")
... | |
d301ddb3e8c5f47e07f83af808c82aa84f8b32768251ce7a94e540a17ea6c9be | ocaml-sf/learn-ocaml-corpus | merge_dup.ml | let rec odd (xs : 'a list) : 'a list =
match xs with
| [] ->
[]
| _ :: xs ->
even xs
and even (xs : 'a list) : 'a list =
match xs with
| [] ->
[]
| x :: xs ->
x :: odd xs
let rec merge (xs : int list) (ys : int list) : int list =
match xs, ys with
| [], _ ->
ys
| _, [] ... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/merge_sort/wrong/merge_dup.ml | ocaml | wrong: losing a duplicate | let rec odd (xs : 'a list) : 'a list =
match xs with
| [] ->
[]
| _ :: xs ->
even xs
and even (xs : 'a list) : 'a list =
match xs with
| [] ->
[]
| x :: xs ->
x :: odd xs
let rec merge (xs : int list) (ys : int list) : int list =
match xs, ys with
| [], _ ->
ys
| _, [] ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.