_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 |
|---|---|---|---|---|---|---|---|---|
26f27d1487781ac0db8e5683e90cb558a48228794d73ea1c5f522c1b3c907d55 | haroldcarr/learn-haskell-coq-ml-etc | X_2011_12_31_functors.hs | module X_2011_12_31_functors
where
Created : 2014 Oct 07 ( Tue ) 08:53:35 by .
Last Modified : 2015 Sep 01 ( Tue ) 14:44:47 by .
2011 - 12 - 31
-for-mainstream-programmers-code.html
FUNCTORS
category theory is the mathematician 's version of code reuse
- identifies patterns common to every br... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/topic/general/haskellforall/src/X_2011_12_31_functors.hs | haskell | Just 4
Nothing
actually a newtype and I 've flipped the output
actually a newtype
a pure function
no different
i.e. ( RealWorld - > ( RealWorld , String ) )
i.e. ( RealWorld - > ( RealWorld , Int ) )
Just 4
Nothing
actually a newtype and I've flipped the output
actually a newtype
a pure function
n... | module X_2011_12_31_functors
where
Created : 2014 Oct 07 ( Tue ) 08:53:35 by .
Last Modified : 2015 Sep 01 ( Tue ) 14:44:47 by .
2011 - 12 - 31
-for-mainstream-programmers-code.html
FUNCTORS
category theory is the mathematician 's version of code reuse
- identifies patterns common to every br... |
224de45ecb40356d10817ae33f5ecffd2822e00fc61c26c4d37f1f7050721db9 | inria-parkas/sundialsml | cvsAdvDiff_ASAi_bnd.ml |
* -----------------------------------------------------------------
* $ Revision : 1.3 $
* $ Date : 2011/11/23 23:53:02 $
* -----------------------------------------------------------------
* Programmer(s ): @ LLNL
* -----------------------------------------------------------------
* OCaml port :... | null | https://raw.githubusercontent.com/inria-parkas/sundialsml/a1848318cac2e340c32ddfd42671bef07b1390db/examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.ml | ocaml | Problem Constants
domain boundaries
mesh dimensions
number of equations
scalar absolute tolerance
initial time
first output time
output time increment
number of output times
final time
Type : UserData (contains grid constants)
... |
* -----------------------------------------------------------------
* $ Revision : 1.3 $
* $ Date : 2011/11/23 23:53:02 $
* -----------------------------------------------------------------
* Programmer(s ): @ LLNL
* -----------------------------------------------------------------
* OCaml port :... |
505e296aa741ede716a5618932a6827d5a5d360a9fef530f319556f0bc851adb | MondayMorningHaskell/AdventOfCode | Amphipods.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeFamilies #
module Amphipods where
import Control.Monad
import Data.Hashable
import Data.Maybe (catMaybes)
import Data.List (sortOn)
import qualified Data.Heap as H
import qualified Data.Map as M
import qualified Data.Set as Set
impor... | null | https://raw.githubusercontent.com/MondayMorningHaskell/AdventOfCode/ec3160a219900f3945bb10b099ebfd588cbd19b8/src/Amphipods.hs | haskell | # LANGUAGE DeriveAnyClass #
Node
Distance
Edges (what are the moves we can make?)
print (M.size $ djDist djs)
print (Set.size $ djVisited djs)
print (last finalSorted)
print finalState
Try moving each one in the hallway
| # LANGUAGE DeriveGeneric #
# LANGUAGE TypeFamilies #
module Amphipods where
import Control.Monad
import Data.Hashable
import Data.Maybe (catMaybes)
import Data.List (sortOn)
import qualified Data.Heap as H
import qualified Data.Map as M
import qualified Data.Set as Set
import GHC.Generics
import Dijkstra... |
684f0c3e29467ecd80b304532c4a30451a23ee3d9ffcfe306eef581715ef51b6 | JeffreyBenjaminBrown/hode | Main.hs | # LANGUAGE OverloadedStrings
, ScopedTypeVariables
, TupleSections #
, ScopedTypeVariables
, TupleSections #-}
module Hode.UI.Main where
import Control.Lens
import qualified Data.List.PointedList as P
import qualified Data.Set as S
import qualified Data.Map as M
import ... | null | https://raw.githubusercontent.com/JeffreyBenjaminBrown/hode/79a54a6796fa01570cde6903b398675c42954e62/hode-ui/Hode/UI/Main.hs | haskell | | The focused subview is recalculated at each call to `appDisplay`.
Each `ViewExprNodeTree`'s `viewIsFocused` field is `False` outside of `appDisplay`.
set focus in the SubgraphBuffer window
pipe user input into the LangCmds window
black = gray 0
PITFALL : Vty offers darker non - black grays .
See VTY issue
u... | # LANGUAGE OverloadedStrings
, ScopedTypeVariables
, TupleSections #
, ScopedTypeVariables
, TupleSections #-}
module Hode.UI.Main where
import Control.Lens
import qualified Data.List.PointedList as P
import qualified Data.Set as S
import qualified Data.Map as M
import ... |
ccc1081ca8d251ac460d77c43af5f12808b63cba5ec7a0a320fa02d451df0c42 | serokell/ariadne | Decrypt.hs | -- | Contains some utils to decrypt HD payload of addresses.
Also utils to create THEntryExtra which based on
decrypting of HDPayload .
module Ariadne.Wallet.Cardano.Kernel.Decrypt
( WAddressMeta (..)
, THEntryExtra (..)
, isTxEntryInteresting
, buildTHEntryExtra
, HDPassphrase... | null | https://raw.githubusercontent.com/serokell/ariadne/5f49ee53b6bbaf332cb6f110c75f7b971acdd452/ariadne/cardano/src/Ariadne/Wallet/Cardano/Kernel/Decrypt.hs | haskell | | Contains some utils to decrypt HD payload of addresses.
belonging to some wallet.
which belong to wallet
which belong to wallet
^ Tx entry for history, likely it's not our entry | Also utils to create THEntryExtra which based on
decrypting of HDPayload .
module Ariadne.Wallet.Cardano.Kernel.Decrypt
( WAddressMeta (..)
, THEntryExtra (..)
, isTxEntryInteresting
, buildTHEntryExtra
, HDPassphrase
, eskToHDPassphrase
, selectOwnAddresses
... |
849059a2597980c64e44e4b26417c93cffc0f36f4ba0144fc3dae16c8bb40fae | Ramarren/cells | person.lisp | ;; -*- mode: Lisp; Syntax: Common-Lisp; Package: cells; -*-
;;;
;;;
Copyright ( c ) 1995,2003 by .
;;;
;;; Permission is hereby granted, free of charge, to any person obtaining a copy
;;; of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , includi... | null | https://raw.githubusercontent.com/Ramarren/cells/cced2e55c363572914358c0a693ebac2caed4e22/cells-test/person.lisp | lisp | -*- mode: Lisp; Syntax: Common-Lisp; Package: cells; -*-
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
to do so, subject to th... | Copyright ( c ) 1995,2003 by .
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is furnished
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIN... |
4e9bb24cbce40ef3ba171f7257e5d5107997828e69d18b188c28811dc2910dbd | semilin/layoup | seht-drai.lisp |
(MAKE-LAYOUT :NAME "seht-drai" :MATRIX
(APPLY #'KEY-MATRIX '("fulvb;gnoj" "sehtkqdrai" "z'mpwycx.,"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/seht-drai.lisp | lisp |
(MAKE-LAYOUT :NAME "seht-drai" :MATRIX
(APPLY #'KEY-MATRIX '("fulvb;gnoj" "sehtkqdrai" "z'mpwycx.,"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | |
bf5dbef5383d15d9385b1a32959f99b2834421b0de0d3b3dbbeb1e674f3764aa | juxt/chatserver | dev.clj | (ns dev
(:require
[clojure.pprint :refer (pprint)]
[clojure.reflect :refer (reflect)]
[clojure.repl :refer (apropos dir doc find-doc pst source)]
[clojure.tools.namespace.repl :refer (refresh refresh-all)]
[clojure.java.io :as io]
[com.stuartsierra.component :as component]
[chatserver.system :ref... | null | https://raw.githubusercontent.com/juxt/chatserver/18a0671d8678a8a02eac6f53119a1cff7469f1d1/dev/dev.clj | clojure | REPL Convenience helpers
~/chatserver/dev/dev.clj | (ns dev
(:require
[clojure.pprint :refer (pprint)]
[clojure.reflect :refer (reflect)]
[clojure.repl :refer (apropos dir doc find-doc pst source)]
[clojure.tools.namespace.repl :refer (refresh refresh-all)]
[clojure.java.io :as io]
[com.stuartsierra.component :as component]
[chatserver.system :ref... |
03c37ca8d372361dc058859cc695f59a27dda9c495362797b5883e7dc9bb5963 | philnguyen/soft-contract | main.rkt | #lang typed/racket/base
(provide prims@)
(require typed/racket/unit
set-extras
"../ast/signatures.rkt"
"../runtime/signatures.rkt"
"../execution/signatures.rkt"
"../signatures.rkt"
"signatures.rkt"
"prim-runtime.rkt"
"relations.rkt"
"pri... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/primitives/main.rkt | racket | #lang typed/racket/base
(provide prims@)
(require typed/racket/unit
set-extras
"../ast/signatures.rkt"
"../runtime/signatures.rkt"
"../execution/signatures.rkt"
"../signatures.rkt"
"signatures.rkt"
"prim-runtime.rkt"
"relations.rkt"
"pri... | |
2718bd528900e099cb9b01eb3116c273b8bf31e6614868769a919882c7547057 | elaforge/karya | Repl.hs | Copyright 2013
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
-- | Put your own local commands here and reload with @:r@. You can also put
-- local imports, e.g. import modules out of User.Elaforge.Instrument to get
-- at per-instrument allocation... | null | https://raw.githubusercontent.com/elaforge/karya/471a2131f5a68b3b10b1a138e6f9ed1282980a18/User/Elaforge/Repl.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
| Put your own local commands here and reload with @:r@. You can also put
local imports, e.g. import modules out of User.Elaforge.Instrument to get
at per-instrument allocations.
chords
sfx
percussion
p... | Copyright 2013
module User.Elaforge.Repl where
import qualified Util.Log as Log
import qualified Cmd.Cmd as Cmd
import qualified Cmd.Repl.LInst as LInst
test_cmd :: Cmd.CmdL ()
test_cmd = Log.notice "test command"
underwater = do
let a = LInst.add
a "marim" "pianoteq/" "loop1" [0]
a "bass" "pianote... |
37ce82c15deba43b2c95a118a916b85797a360436d28abd6eeeca2a9467e59d1 | aws-beam/aws-erlang | aws_billingconductor.erl | %% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
See -beam/aws-codegen for more details .
@doc Amazon Web Services Billing Conductor is a fully managed service that
%% you can use to customize a pro forma version of your billing data each
%% month, to accurately show or chargeback your end customers.
%%
Amazon Web ... | null | https://raw.githubusercontent.com/aws-beam/aws-erlang/699287cee7dfc9dc8c08ced5f090dcc192c9cba8/src/aws_billingconductor.erl | erlang | WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
you can use to customize a pro forma version of your billing data each
month, to accurately show or chargeback your end customers.
provides you with a mechanism to configure, generate, and display rates to
certain customers over a given billing period. You can also analy... | See -beam/aws-codegen for more details .
@doc Amazon Web Services Billing Conductor is a fully managed service that
Amazon Web Services Billing Conductor does n't change the way
you 're billed by Amazon Web Services each month by design . Instead , it
relative to your actual rates from Amazon Web Services . ... |
61220c498f5f3fa5a5ffbe536631da41deed366dfc86b7f22b98294d2e27496a | shirok/Gauche-LoL | wumpus.scm | (use scheme.list) ;lset-intersection etc.
(use srfi.27) ;random-integer
list - ec etc .
(load "./graph-util")
(define *congestion-city-nodes* '())
(define *congestion-city-edges* '())
(define *visited-nodes* '())
(define *node-num* 30)
(define *edge-num* 45)
(define *worm-num* 3)
(define *cop-odds* 15)
(define *pl... | null | https://raw.githubusercontent.com/shirok/Gauche-LoL/d19a53e459a57d0b4e97661a9e8065aff36efa08/wumpus.scm | scheme | lset-intersection etc.
random-integer
;; provisional version. see below.
(define (new-game)
(set! *congestion-city-edges* (make-city-edges))
(set! *congestion-city-nodes* (make-city-nodes *congestion-city-edges*))
(set! *player-pos* (find-empty-node))
(set! *visited-nodes* (list *player-pos*))
(draw-city))
... | list - ec etc .
(load "./graph-util")
(define *congestion-city-nodes* '())
(define *congestion-city-edges* '())
(define *visited-nodes* '())
(define *node-num* 30)
(define *edge-num* 45)
(define *worm-num* 3)
(define *cop-odds* 15)
(define *player-pos* 1)
(define (random-node)
(+ 1 (random-integer *node-num*)))
(... |
0ef553d709e625cd975137309fd83fff2959156823322267c4ddc08ad747202e | simingwang/emqx-plugin-kafkav5 | asn1ct_gen_jer.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2019 - 2022 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/simingwang/emqx-plugin-kafkav5/bbf919e56dbc8fd2d4c1c541084532f844a11cbc/_build/default/rel/emqx_plugin_kafka/lib/asn1-5.0.18/src/asn1ct_gen_jer.erl | erlang |
%CopyrightBegin%
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 lan... | Copyright Ericsson AB 2019 - 2022 . 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(asn1ct_gen_jer).
all types in an ASN.1 module
-include("asn1_records.hrl").
-export([gen_encode/2,gen_en... |
cfda5c0b83372efd913b0f4ea01defc3f13a977d12b647cffacc613424cc5a8f | c-cube/sqlite3_utils | make.ml |
let () =
if Sys.command "which qtest > /dev/null" <> 0 then (
(* create empty file *)
) else (
let files = "../src/sqlite3_utils.ml ../src/sqlite3_utils.mli" in
let cmd =
Printf.sprintf "qtest extract %s 2>/dev/null"
files
in
exit (Sys.command cmd)
)
| null | https://raw.githubusercontent.com/c-cube/sqlite3_utils/7099e01e4f437c3aed84d5b73b4f7f41287ab736/qtest/make.ml | ocaml | create empty file |
let () =
if Sys.command "which qtest > /dev/null" <> 0 then (
) else (
let files = "../src/sqlite3_utils.ml ../src/sqlite3_utils.mli" in
let cmd =
Printf.sprintf "qtest extract %s 2>/dev/null"
files
in
exit (Sys.command cmd)
)
|
8048b8e402ff903703421603e7c0fa98c754400f975a4ad67d5b82fe405af15a | titola/incudine | foreign-array.lisp | Copyright ( c ) 2013 - 2018
;;;
;;; This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
;;; (at your option) any later version.
;;;
;;; This program is distri... | null | https://raw.githubusercontent.com/titola/incudine/325174a54a540f4daa67bcbb29780073c35b7b80/src/foreign-array.lisp | lisp |
This program is free software; you can redistribute it and/or modify
either version 2 of the License , or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR... | Copyright ( c ) 2013 - 2018
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
Foundation , Inc. , 51 Franklin St , Fifth Floor , Boston , MA 02110 - 1301 USA
(in-package :incudine)
(defstruct (foreign-array (:include in... |
072fd1fde719ed5f23b06cea8e550c1ad7818c3b45e2cf397760e43f3ac82081 | staples-sparx/kits | syslog.clj | (ns ^{:doc "UDP based syslog client (pure Java)."}
kits.syslog
(:require
[kits.syslog.messages :as messages]
[kits.syslog.udp :as udp]
[kits.timestamp :as ts])
(:import
kits.syslog.udp.Channel))
(set! *warn-on-reflection* true)
;; -remote-logging-on-mac-os-x/
;; -syslog-considered-harmful-or-at-... | null | https://raw.githubusercontent.com/staples-sparx/kits/66ae99bce83e8fd1248cc5c0da1f23673f221073/src/clojure/kits/syslog.clj | clojure | -remote-logging-on-mac-os-x/
-syslog-considered-harmful-or-at-least-undocumented/
each item must be resolved within a given time"
:local-name "aegis[81357]"
(example) | (ns ^{:doc "UDP based syslog client (pure Java)."}
kits.syslog
(:require
[kits.syslog.messages :as messages]
[kits.syslog.udp :as udp]
[kits.timestamp :as ts])
(:import
kits.syslog.udp.Channel))
(set! *warn-on-reflection* true)
(def levels {:debug 7
:info 6
:notice 5
... |
1fc89917765ca924dcbae4caaf87cdfde8aca4e1611ead777113dc02426de2db | voxoz/emqttd | emqttd_app.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2013 - 2017 EMQ Enterprise , Inc. ( )
%%
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
%%
%% ... | null | https://raw.githubusercontent.com/voxoz/emqttd/2be612e0e7a00a866cd9af350a030966d73fbc09/src/emqttd_app.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 ) 2013 - 2017 EMQ Enterprise , Inc. ( )
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqttd_app).
-behaviour(application).
-author("Feng Lee <>").
-include("emqttd_cli.hrl").
-include("emqttd_... |
c5cc60eca1fff7431b93d3c26d2ddfb33fc7d5fbad41fde94373fa2ddcb24e29 | RyanGlScott/text-show | EitherSpec.hs | |
Module : Spec . Data . EitherSpec
Copyright : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : GHC
@hspec@ tests for ' Either ' .
Module: Spec.Data.EitherSpec
Copyright: (C) 2014-2017 Ryan Scott
License: ... | null | https://raw.githubusercontent.com/RyanGlScott/text-show/5ea297d0c7ae2d043f000c791cc12ac53f469944/tests/Spec/Data/EitherSpec.hs | haskell | |
Module : Spec . Data . EitherSpec
Copyright : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Stability : Provisional
Portability : GHC
@hspec@ tests for ' Either ' .
Module: Spec.Data.EitherSpec
Copyright: (C) 2014-2017 Ryan Scott
License: ... | |
0ea013bd2cfab972127d357b5459cb2c9e7556454a1bea194fcdd83ed17022c4 | zotonic/zotonic | filter_split_in.erl | @author < >
2010
@doc ' ' filter , split a list in a number of rows
Copyright 2010
%%
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 requi... | null | https://raw.githubusercontent.com/zotonic/zotonic/852f627c28adf6e5212e8ad5383d4af3a2f25e3f/apps/zotonic_mod_base/src/filters/filter_split_in.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 perm... | @author < >
2010
@doc ' ' filter , split a list in a number of rows
Copyright 2010
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(filter_split_in).
-export([split_in/3]).
split_in(undefined, _N, ... |
788986373eca5f2730d16012b97ec440dbe6230dc2b9f074c63947ef8ee5bd67 | cac-t-u-s/om-sharp | libsndfile.lisp | ;============================================================================
; om#: visual programming language for computer-assisted music composition
;============================================================================
;
; This program is free software. For information on usage
; and redistribution... | null | https://raw.githubusercontent.com/cac-t-u-s/om-sharp/74aa97891177de1d167aa5963be00f0d453a3bcd/src/packages/sound/audio-api/libsndfile/libsndfile.lisp | lisp | ============================================================================
om#: visual programming language for computer-assisted music composition
============================================================================
This program is free software. For information on usage
and redistribution, see ... | File author :
(in-package :cl-user)
(defpackage "libsndfile"
(:nicknames "SF")
(:use common-lisp cffi))
(in-package :sf)
(pushnew :libsndfile *features*)
( defctype : long - long : pointer )
(defconstant SF_FORMAT_WAV #x010000)
(defconstant SF_FORMAT_AIFF #x020000)
(defconstant SF_FORMAT... |
7e18dadd65b538572dab9eaaa1368c4828c816fc3e2270226fa3bb829d694806 | tdietert/types-as-specifications | TypeFamilies.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE TypeOperators #
# LANGUAGE PolyKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeApplications #
module Playground.TypeFamilies where
{-
Th... | null | https://raw.githubusercontent.com/tdietert/types-as-specifications/25ae56b0cec733ae3c2926b36e17878b0da2a9f0/src/Playground/TypeFamilies.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
This module illustrates a question I had about type family evaluation.
See the reddit discussion here:
/
| # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE TypeOperators #
# LANGUAGE PolyKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# LANGUAGE TypeApplications #
module Playground.TypeFamilies where
import GHC.TypeLits ( ErrorM... |
0a7d65165a90a7ed8e45f2c0d2e715cf6de4d82acd27794e5a232ce8f6bccc64 | micahasmith/crypto-watch | websockets_test.clj | (ns crypto.infra.websockets-test
(:require [clojure.test :refer :all]
[crypto.infra.helpers :refer :all]
[crypto.infra.websockets :as websockets]
[clojure.core.async :as a]))
(deftest start!-tests
(testing "when create-feed-client fails it keeps retrying until shutdown is calle... | null | https://raw.githubusercontent.com/micahasmith/crypto-watch/265d03148a018e422513a6daee67cf6e58ac12bf/crypto/test/crypto/infra/websockets_test.clj | clojure | (loop [] (recur)) | (ns crypto.infra.websockets-test
(:require [clojure.test :refer :all]
[crypto.infra.helpers :refer :all]
[crypto.infra.websockets :as websockets]
[clojure.core.async :as a]))
(deftest start!-tests
(testing "when create-feed-client fails it keeps retrying until shutdown is calle... |
c47b88c40223d51d0cd2d986e72014a7a337c71a284d2541a2bf1fec34c089d3 | samply/blaze | library.clj | (ns blaze.elm.compiler.library
(:require
[blaze.anomaly :as ba :refer [if-ok when-ok]]
[blaze.elm.compiler :as compiler]
[blaze.elm.compiler.function :as function]
[blaze.elm.deps-infer :as deps-infer]
[blaze.elm.equiv-relationships :as equiv-relationships]
[blaze.elm.normalizer :as normalizer... | null | https://raw.githubusercontent.com/samply/blaze/693d07d8fbf9ac4e11af6684978e108bbd193780/modules/cql/src/blaze/elm/compiler/library.clj | clojure | (ns blaze.elm.compiler.library
(:require
[blaze.anomaly :as ba :refer [if-ok when-ok]]
[blaze.elm.compiler :as compiler]
[blaze.elm.compiler.function :as function]
[blaze.elm.deps-infer :as deps-infer]
[blaze.elm.equiv-relationships :as equiv-relationships]
[blaze.elm.normalizer :as normalizer... | |
2cc715e3d80cab4eebaaa9634c3779cbe0b792bf15362050bdc09a3c7dd18cbd | schemeorg-community/index.scheme.org | racket.scm | (
;; r6rs
((rnrs base (6)) . #t)
((rnrs arithmetic bitwise (6)) . #t)
((rnrs arithmetic fixnum (6)) . #t)
((rnrs arithmetic flonum (6)) . #t)
((rnrs bytevectors (6)) . #t)
((rnrs conditions (6)) . #t)
((rnrs control (6)) . #t)
((rnrs eval (6)) . #t)
((rnrs files (6)) . #t)
((rnrs hashtables (6)) .... | null | https://raw.githubusercontent.com/schemeorg-community/index.scheme.org/32e1afcfe423a158ac8ce014f5c0b8399d12a1ea/filters/racket.scm | scheme | r6rs
| (
((rnrs base (6)) . #t)
((rnrs arithmetic bitwise (6)) . #t)
((rnrs arithmetic fixnum (6)) . #t)
((rnrs arithmetic flonum (6)) . #t)
((rnrs bytevectors (6)) . #t)
((rnrs conditions (6)) . #t)
((rnrs control (6)) . #t)
((rnrs eval (6)) . #t)
((rnrs files (6)) . #t)
((rnrs hashtables (6)) . #t)
((r... |
ea78d9a8f7eead441267f61bb6c6b4ff4239d66d6a00321ad8c980648478822f | haroldcarr/learn-haskell-coq-ml-etc | HOTL.hs | # OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE DataKinds #
{-# LANGUAGE GADTs #-}
# LANGUAGE InstanceSigs #
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PolyKinds #
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeFamilies #-}
{-# L... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/topic/type-level/2018-06-csongor-kiss-higher-order-type-level/HOTL.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE KindSignatures #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeInType #
# LANGUAGE TypeOperators #
-college/faculty-of-engineering/computing/public/ug-prizes-201718/Csongor-Kiss-Higher-order-type-level-programming-in-Haskell.pdf
im... | # OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE DataKinds #
# LANGUAGE InstanceSigs #
# LANGUAGE PolyKinds #
# LANGUAGE TypeApplications #
module HOTL where
import Data.Text as T
p 7 : 1.2 Type - level properties
data Nat
= Zero
| Succ Nat
GADTs [ and , 200... |
6e1d1f3fd48fb03be197be5bcb0266bb341c9e1ad7be258cde744b86e521ba49 | weldr/bdcs | Filesystem.hs | -- |
-- Module: BDCS.Utils.Filesystem
Copyright : ( c ) 2016 - 2017 Red Hat , Inc.
-- License: LGPL
--
Maintainer :
-- Stability: alpha
-- Portability: portable
--
-- Filesystem related utility functions
module BDCS.Utils.Filesystem(doesPathExist)
where
import Control.Exception(catchJust)
import Control.Monad(g... | null | https://raw.githubusercontent.com/weldr/bdcs/cf360c3240644b4847336b9d58b2067f3aa1ec50/src/BDCS/Utils/Filesystem.hs | haskell | |
Module: BDCS.Utils.Filesystem
License: LGPL
Stability: alpha
Portability: portable
Filesystem related utility functions
| A version of doesPathExist that also returns True if the path exists
and is a broken symlink. | Copyright : ( c ) 2016 - 2017 Red Hat , Inc.
Maintainer :
module BDCS.Utils.Filesystem(doesPathExist)
where
import Control.Exception(catchJust)
import Control.Monad(guard)
import System.IO.Error(doesNotExistErrorType, ioeGetErrorType)
import System.Posix.Files(getSymbolicLinkStatus)
doesPathExist :: FilePath -... |
302e5cb03baeab784b383dc09272c90072a2f65f6350b9c071cc955f94ae8cd5 | eugeneia/athens | jpl-util.lisp | (in-package #:jpl-util)
(defmacro lambda* (args &body body)
"Creates a function. Takes an extended, rather than an ordinary, lambda list."
;; TODO: Consider optimizing for the case that args can be expressed
;; in an ordinary lambda.
(let ((args-sym (gensym)))
`(function (lambda (&rest ,args-sym)
... | null | https://raw.githubusercontent.com/eugeneia/athens/cc9d456edd3891b764b0fbf0202a3e2f58865cbf/quicklisp/dists/quicklisp/software/cl-jpl-util-20151031-git/jpl-util.lisp | lisp | TODO: Consider optimizing for the case that args can be expressed
in an ordinary lambda.
Presumably immutable objects.
Example: combines strings. Note that sublists are not traversed.
(combine-elements '("f" "o" "o" ("bar" "forever") "!")
(lambda (e1 e2) (concatenate 'string e1 e2)))
=> ("foo"... | (in-package #:jpl-util)
(defmacro lambda* (args &body body)
"Creates a function. Takes an extended, rather than an ordinary, lambda list."
(let ((args-sym (gensym)))
`(function (lambda (&rest ,args-sym)
(destructuring-bind ,args ,args-sym
,@body)))))
(defgeneric copy-object (obj)
(:documentation... |
7ca782dfa99c7530ff6c8f814fb4293f2ad828e8b04b7d332a8c5a187c6a2bdd | y42/clj-druid | extraction.clj | (ns clj-druid.schemas.extraction
(:require [schema.core :as s]
[clj-druid.schemas.search-query :refer [searchQuery]]))
(s/defschema regularExpressionExtractionFunction
{:type (s/enum :regex)
:expr s/Str})
(s/defschema partialExtractionFunction
{:type (s/enum :partial)
:expr s/Str})
(s/defsche... | null | https://raw.githubusercontent.com/y42/clj-druid/37fc967f000dc63816610695a2b6c028b7b7d8b5/src/clj_druid/schemas/extraction.clj | clojure | (ns clj-druid.schemas.extraction
(:require [schema.core :as s]
[clj-druid.schemas.search-query :refer [searchQuery]]))
(s/defschema regularExpressionExtractionFunction
{:type (s/enum :regex)
:expr s/Str})
(s/defschema partialExtractionFunction
{:type (s/enum :partial)
:expr s/Str})
(s/defsche... | |
c779d54a882ecac77484516be66521aeea83465da1cabf901ded6c1cb6f6a23b | cheshire/onumerical | chem_parser.mli | (**
* Converting chemical equations from strings to datastructures and back
*)
open Core.Std
(** Serializable representation for the chemical equation
* (with no coefficients) *)
type t = {lhs: formula_t; rhs: formula_t}
and formula_t = molecule_t list
and molecule_t = (atom_t * coeff_t) list
and coeff_t = int
... | null | https://raw.githubusercontent.com/cheshire/onumerical/2ebe77edb61c761f1e1397dc37369f2cdc8021f7/src/chem_parser.mli | ocaml | *
* Converting chemical equations from strings to datastructures and back
* Serializable representation for the chemical equation
* (with no coefficients)
* Submodule for the equation with coefficients attached to molecules
* Serializable representation for the chemical equation with
* coefficients
Conv... |
open Core.Std
type t = {lhs: formula_t; rhs: formula_t}
and formula_t = molecule_t list
and molecule_t = (atom_t * coeff_t) list
and coeff_t = int
and atom_t = string with sexp
module Coeff_equation : sig
type coeff_t = {lhs_c: coeff_formula_t; rhs_c: coeff_formula_t}
and coeff_formula_t = (int * molecule_... |
874ac3a06ea95c946ebd55866abdd59a9e79dbb50962324b16506c36a85798b1 | lisp-mirror/cl-tar | gnu.lisp | (in-package #:tar-create-test)
(para:define-test create-gnu
(with-temp-dir ()
(nix:mkdir (merge-pathnames "test/") (logior nix:s-irwxu
nix:s-irgrp nix:s-ixgrp
nix:s-iroth nix:s-ixoth))
(with-open-file (s "test/a... | null | https://raw.githubusercontent.com/lisp-mirror/cl-tar/7c6e07a10c93d9e311f087b5f6328cddd481669a/test/create/gnu.lisp | lisp | (in-package #:tar-create-test)
(para:define-test create-gnu
(with-temp-dir ()
(nix:mkdir (merge-pathnames "test/") (logior nix:s-irwxu
nix:s-irgrp nix:s-ixgrp
nix:s-iroth nix:s-ixoth))
(with-open-file (s "test/a... | |
a52e8a40d4516e5bebd1cbabbf579d0e5de88b90226e4aaf017109f84751d538 | guilespi/time-series-storage | schema.clj | (ns time-series-storage.sql-server.schema
(:refer-clojure :exclude [distinct group-by update])
(:require [clojure.java.jdbc :as j]
[sqlingvo.db :as sqdb]
[clojure.string :as string])
(:use sqlingvo.core
time-series-storage.postgres.common))
(def sqdb (sqdb/sqlserver))
(defn get-f... | null | https://raw.githubusercontent.com/guilespi/time-series-storage/cd6dc438a14ded8407b35139d6d5bc1509dedce2/src/time_series_storage/sql_server/schema.clj | clojure | if keys do not match some dimension does not exist
primary key is composite on all dimensions + timestamp
this looks like magic because it is, a monad sequence transformer
dynamically appends columns to current statement | (ns time-series-storage.sql-server.schema
(:refer-clojure :exclude [distinct group-by update])
(:require [clojure.java.jdbc :as j]
[sqlingvo.db :as sqdb]
[clojure.string :as string])
(:use sqlingvo.core
time-series-storage.postgres.common))
(def sqdb (sqdb/sqlserver))
(defn get-f... |
d65793067aed735f00ffa75a7b16570eabfb6278ef3389294013e9c7358fdfda | scmlab/gcl | Substitution.hs | # LANGUAGE FlexibleInstances , FlexibleContexts ,
OverloadedStrings , LambdaCase #
OverloadedStrings, LambdaCase #-}
module GCL.Substitution
( run
, buildRedexMap
, step
, Decls
-- TODO: don't export these
, Substitutable
, Reducible
, CollectRedexes
) where
import ... | null | https://raw.githubusercontent.com/scmlab/gcl/01110fdb131a2db34e2ac7a6533a30f34c91d995/src/GCL/Substitution.hs | haskell | TODO: don't export these
----------------------------------------------------------------
declarations
-> Int -- initial redex ID counter
name of variables to be substituted
values to be substituted for
----------------------------------------------------------------
-----------------------------------------------... | # LANGUAGE FlexibleInstances , FlexibleContexts ,
OverloadedStrings , LambdaCase #
OverloadedStrings, LambdaCase #-}
module GCL.Substitution
( run
, buildRedexMap
, step
, Decls
, Substitutable
, Reducible
, CollectRedexes
) where
import Control.Monad.RWS
import ... |
a83577a7e547990febb9422e6417be2399ae2fb89023b0dd22080ee0f7cd7713 | diku-kmc/kleenexlang | OneApproximation.hs | # LANGUAGE TypeFamilies #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE QuasiQuotes #
module Tests.OneApproximation where
import Data.ByteString.Char8 (pack)
import Data.ByteString (unpack)
import qualified Data.Map as M
import Data.Monoid
import Data.Word
import qualified Distri... | null | https://raw.githubusercontent.com/diku-kmc/kleenexlang/d474c6015339c261b2e7bf37061175fd69185baf/test/Tests/OneApproximation.hs | haskell | Unit tests
Quickcheck tests
^ Number of quickcheck runs pr program
------------------------------------------------------------------------------
Generator
------------------------------------------------------------------------------
| Generates a matching string and a fussed string from a program
| Generates a ... | # LANGUAGE TypeFamilies #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE QuasiQuotes #
module Tests.OneApproximation where
import Data.ByteString.Char8 (pack)
import Data.ByteString (unpack)
import qualified Data.Map as M
import Data.Monoid
import Data.Word
import qualified Distri... |
8b2226b293c11a9078055c9d22795fea2f0a7a6778f3b12a17f3058b20d721de | exercism/haskell | Proverb.hs | module Proverb(recite) where
import Data.List (intercalate)
type Input = String
type Recital = String
phrase :: Input -> Input -> String
phrase x y = "For want of a " ++ x ++ " the " ++ y ++ " was lost."
ending :: Input -> String
ending w = "And all for the want of a " ++ w ++ "."
joinLines :: [String] -> Recital
... | null | https://raw.githubusercontent.com/exercism/haskell/ae17e9fc5ca736a228db6dda5e3f3b057fa6f3d0/exercises/practice/proverb/.meta/examples/success-standard/src/Proverb.hs | haskell | module Proverb(recite) where
import Data.List (intercalate)
type Input = String
type Recital = String
phrase :: Input -> Input -> String
phrase x y = "For want of a " ++ x ++ " the " ++ y ++ " was lost."
ending :: Input -> String
ending w = "And all for the want of a " ++ w ++ "."
joinLines :: [String] -> Recital
... | |
0c10762bce7523e06259a40248b7f5a958395b36ee2a97d221ace04f79c4cce4 | DataHaskell/dh-core | Benchmark.hs | # OPTIONS_GHC -Wno - orphans #
# LANGUAGE DataKinds #
# LANGUAGE LambdaCase #
module Numeric.Dataloader.Benchmark where
import Control.DeepSeq
import Control.Concurrent
import Numeric.Dataloader
import Numeric.Datasets
import Numeric.Datasets.Abalone
import Streaming (Of)
import qualified Streaming.Prelude as S
impo... | null | https://raw.githubusercontent.com/DataHaskell/dh-core/ead0d58443c01e2578af38bc8185bc6f2c805604/datasets/bench/Numeric/Dataloader/Benchmark.hs | haskell | ImageLoading bench
-----------------------------------------------------------------------------
Image Folder loading
| dataloading the image folder dataset | # OPTIONS_GHC -Wno - orphans #
# LANGUAGE DataKinds #
# LANGUAGE LambdaCase #
module Numeric.Dataloader.Benchmark where
import Control.DeepSeq
import Control.Concurrent
import Numeric.Dataloader
import Numeric.Datasets
import Numeric.Datasets.Abalone
import Streaming (Of)
import qualified Streaming.Prelude as S
impo... |
3b186d955858c0e2c8be5fe5ae4cdfb69008a30d401dc04c54d85b4c48bd1271 | feeley/etos | scm-build.scm | ; file: "scm-build.scm"
Copyright ( C ) 1998 - 1999 Universite de Montreal , All Rights Reserved .
; Scheme code construction set
(define identity '(lambda (x) x))
(define (quote? scm)
(and (pair? scm) (eq? (car scm) 'quote)))
(define (quoted-atom? scm)
(and (pair? scm) (eq? (car scm) 'quote) (symbol? (cadr... | null | https://raw.githubusercontent.com/feeley/etos/da9f089c1a7232d97827f8aa4f4b0862b7c5551f/compiler/scm-build.scm | scheme | file: "scm-build.scm"
Scheme code construction set
a constant
a simple lambda
a thunk-call lambda body
(if (or test-effect then-effect else-effect)
(list 'if
(if-test scm)
then-effect
else-effect)
#f)))
(gen-let (let-bindings scm) (scm-effect (let-body scm))))
Here, we make common... |
Copyright ( C ) 1998 - 1999 Universite de Montreal , All Rights Reserved .
(define identity '(lambda (x) x))
(define (quote? scm)
(and (pair? scm) (eq? (car scm) 'quote)))
(define (quoted-atom? scm)
(and (pair? scm) (eq? (car scm) 'quote) (symbol? (cadr scm))))
(define (lambda? scm)
(and (pair? scm) (eq?... |
20dd5714c1afe1ad1fa572682fdc400b841787d61d769825acf7d35cee43ff0d | thheller/shadow-cljsjs | vega_lite.cljs | (ns cljsjs.vega-lite
(:require ["vega-lite" :as vega-lite]))
(js/goog.exportSymbol "vl" vega-lite) | null | https://raw.githubusercontent.com/thheller/shadow-cljsjs/eaf350d29d45adb85c0753dff77e276e7925a744/src/main/cljsjs/vega_lite.cljs | clojure | (ns cljsjs.vega-lite
(:require ["vega-lite" :as vega-lite]))
(js/goog.exportSymbol "vl" vega-lite) | |
bc7362fc009f9b3db70e68b2f28a0988535fb736a982eb987312f959d9187114 | cbaggers/cepl.examples | basic-geometry-shader.lisp | (in-package :cepl.examples+camera)
;;- - - - - - - - - - - - - - - - - -
(defparameter sphere-stream nil)
(defparameter brick nil)
(defstruct sphere
(pos (v! 0 0 -10))
(rot (q:identity)))
(defparameter sphere-a (make-sphere :pos (v! 0 0 -1)))
;;- - - - - - - - - - - - - - - - - -
(defun model->world (x)
(m4... | null | https://raw.githubusercontent.com/cbaggers/cepl.examples/87ac3def3e674632662350c809edf09f4820fbd1/examples/basic-geometry-shader.lisp | lisp | - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - | (in-package :cepl.examples+camera)
(defparameter sphere-stream nil)
(defparameter brick nil)
(defstruct sphere
(pos (v! 0 0 -10))
(rot (q:identity)))
(defparameter sphere-a (make-sphere :pos (v! 0 0 -1)))
(defun model->world (x)
(m4:* (m4:translation (sphere-pos x)) (q:to-mat4 (sphere-rot x))))
(defun worl... |
61c4ea7a645741aa707741ace3da062bbec66870dc9e7623212dda3a9236d1db | UBTECH-Walker/WalkerSimulationFor2020WAIC | _package_CollisionDetectionState.lisp | (cl:in-package ubt_core_msgs-msg)
(cl:export '(HEADER-VAL
HEADER
COLLISION_STATE-VAL
COLLISION_STATE
)) | null | https://raw.githubusercontent.com/UBTECH-Walker/WalkerSimulationFor2020WAIC/7cdb21dabb8423994ba3f6021bc7934290d5faa9/walker_WAIC_16.04_v1.2_20200616/walker_install/share/common-lisp/ros/ubt_core_msgs/msg/_package_CollisionDetectionState.lisp | lisp | (cl:in-package ubt_core_msgs-msg)
(cl:export '(HEADER-VAL
HEADER
COLLISION_STATE-VAL
COLLISION_STATE
)) | |
ea107421de66340920309f77d2ba188f1a39432b47b3bd3c2ef522e4d596946e | PacktPublishing/Mastering-Clojure | concurrent.clj | (ns m-clj.c2.concurrent)
Example 2.1
(def delayed-1
(delay
(Thread/sleep 3000)
(println "3 seconds later ...")
1))
;; user> (delay? delayed-1)
;; true
;; user> (realized? delayed-1)
;; false
user > ( realized ? delayed-1 ) ; after 3 seconds
;; false
;; user> @delayed-1
3 seconds later .... | null | https://raw.githubusercontent.com/PacktPublishing/Mastering-Clojure/5364ad907056c1c84c759491b17d45d06f4d7cdc/src/m_clj/c2/concurrent.clj | clojure | user> (delay? delayed-1)
true
user> (realized? delayed-1)
false
after 3 seconds
false
user> @delayed-1
user> (realized? delayed-1)
true
user> @delayed-1
nil
user>
user>
user> (def future-1 (val-as-future 1 3))
#'user/future-1
user>
user>
user> (realized? future-1)
true
user> (future-done? future-1)
... | (ns m-clj.c2.concurrent)
Example 2.1
(def delayed-1
(delay
(Thread/sleep 3000)
(println "3 seconds later ...")
1))
3 seconds later ...
1
NOTE @x is equivalent to ( deref x )
1
Example 2.2
(defn wait-3-seconds []
(Thread/sleep 3000)
(println)
(println "3 seconds later ..."))
user... |
1eebed4ca8c7c10bc2b451a710e094d5c479e830a6edc706367750a8e9dfe3de | Javran/advent-of-code | Nwse.hs | # LANGUAGE PatternSynonyms #
module Javran.AdventOfCode.GridSystem.RowThenCol.Nwse (
Dir (.., North, West, South, East),
Coord,
applyDir,
oppositeDir,
turnLeft,
turnRight,
nwseOfCoord,
allDirs,
) where
import Data.Bifunctor
type Coord = (Int, Int) -- row then col
data Dir = N | W | S | E deriving (E... | null | https://raw.githubusercontent.com/Javran/advent-of-code/676ef13c2f9d341cf7de0f383335a1cf577bd73d/src/Javran/AdventOfCode/GridSystem/RowThenCol/Nwse.hs | haskell | row then col
# INLINEABLE oppositeDir # | # LANGUAGE PatternSynonyms #
module Javran.AdventOfCode.GridSystem.RowThenCol.Nwse (
Dir (.., North, West, South, East),
Coord,
applyDir,
oppositeDir,
turnLeft,
turnRight,
nwseOfCoord,
allDirs,
) where
import Data.Bifunctor
data Dir = N | W | S | E deriving (Eq, Ord, Enum, Show, Bounded)
pattern No... |
4f605e727e9cd6dcbc1a219f402ab404cbac72eb48259cdd678484ab4401d9ed | geneweb/geneweb | output.mli | (** This module uses `conf.output_conf` in order to print an answer to te request.
e.g. send HTML page to the client.
By default:
- GeneWeb's web server set HTTP status to OK if a printing function is used
without a previous call to [status].
- The output channel is a socket given by [gwd]
*)
v... | null | https://raw.githubusercontent.com/geneweb/geneweb/747f43da396a706bd1da60d34c04493a190edf0f/lib/output.mli | ocaml | * This module uses `conf.output_conf` in order to print an answer to te request.
e.g. send HTML page to the client.
By default:
- GeneWeb's web server set HTTP status to OK if a printing function is used
without a previous call to [status].
- The output channel is a socket given by [gwd]
* [sta... |
val status : Config.config -> Def.httpStatus -> unit
val header : Config.config -> ('a, unit, string, unit) format4 -> 'a
val print_string :
Config.config -> [< `encoded | `escaped | `safe ] Adef.astring -> unit
val print_sstring : Config.config -> string -> unit
val printf : Config.config -> ('a, unit, string, ... |
9865ba0be6e05cacb507d35cf9dcbc7010464ba5a882a753751abd6cb2535d38 | returntocorp/semgrep | dQueue.mli | type +'a t
val empty : 'a t
val is_empty : 'a t -> bool
val hd : 'a t -> 'a
val tl : 'a t -> 'a t
val pop : 'a t -> 'a * 'a t
val pop_back : 'a t -> 'a t * 'a
val insert : 'a -> 'a t -> 'a t
val enqueue : 'a -> 'a t -> 'a t
val dequeue : 'a t -> 'a * 'a t
val length : 'a t -> int
val rev : 'a t -> 'a t
val append : 'a... | null | https://raw.githubusercontent.com/returntocorp/semgrep/00f1e67bbb80f00e29db3381288fc00398b6868a/languages/ruby/dyp/dQueue.mli | ocaml | type +'a t
val empty : 'a t
val is_empty : 'a t -> bool
val hd : 'a t -> 'a
val tl : 'a t -> 'a t
val pop : 'a t -> 'a * 'a t
val pop_back : 'a t -> 'a t * 'a
val insert : 'a -> 'a t -> 'a t
val enqueue : 'a -> 'a t -> 'a t
val dequeue : 'a t -> 'a * 'a t
val length : 'a t -> int
val rev : 'a t -> 'a t
val append : 'a... | |
09f81978492eed446a61251be6eff127c2398ea59847f1a7e5650a6afeb4c67d | xach/zs3 | redirects.lisp | ;;;;
Copyright ( c ) 2008 , All Rights Reserved
;;;;
;;;; Redistribution and use in source and binary forms, with or without
;;;; modification, are permitted provided that the following conditions
;;;; are met:
;;;;
;;;; * Redistributions of source code must retain the above copyright
;;;; notice, this list o... | null | https://raw.githubusercontent.com/xach/zs3/1294bd38c4cd00c6b2f628b05ad0f88b193c067a/redirects.lisp | lisp |
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form... | Copyright ( c ) 2008 , All Rights Reserved
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package #:zs3)
(defvar *permanent-redirects*
(make-hash-table :test 'equalp)
"Some bucket operations make permanent redirect... |
40a0ba7246aa3a15fc7678d14ad823b35cd05ea6f8aea299e53fe4682b1da711 | astrada/ocamlfuse | Fuse.mli |
This file is part of the " OCamlFuse " library .
OCamlFuse is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ( version 2 of the License ) .
OCamlFuse is distributed in the hope that it will b... | null | https://raw.githubusercontent.com/astrada/ocamlfuse/08f90ac0b976b94022a7ecac992da9f88e6cd78b/lib/Fuse.mli | ocaml |
This file is part of the " OCamlFuse " library .
OCamlFuse is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ( version 2 of the License ) .
OCamlFuse is distributed in the hope that it will b... | |
be9e3f23dc17b583f981146ba80d7e32aac3f9b26178e2cb16cbbe43e54b757a | namachan10777/scad-ml | rotate_extrude_triangle.ml | open Scad_ml
let triangle_polygon = Scad.polygon [ -0.5, 0.; 0., 1.; 0.5, 0. ]
let rotate_extrude_triangle =
Scad.rotate_extrude (Scad.translate (3., 0., 0.) triangle_polygon)
let () = print_string (Scad.to_string rotate_extrude_triangle)
| null | https://raw.githubusercontent.com/namachan10777/scad-ml/5ab12e515bcb596f2e47d31d46eedd453f47cc62/test/rotate_extrude_triangle.ml | ocaml | open Scad_ml
let triangle_polygon = Scad.polygon [ -0.5, 0.; 0., 1.; 0.5, 0. ]
let rotate_extrude_triangle =
Scad.rotate_extrude (Scad.translate (3., 0., 0.) triangle_polygon)
let () = print_string (Scad.to_string rotate_extrude_triangle)
| |
219459a9f4a6e6ff3d7f43b5f668b5831cb2b18d31b8b9815235aa3d4acaeea2 | clojure/clojurescript | pprint.cljc | Copyright ( c ) . All rights reserved .
;; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( -1.0.php )
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the t... | null | https://raw.githubusercontent.com/clojure/clojurescript/a4673b880756531ac5690f7b4721ad76c0810327/src/main/cljs/cljs/pprint.cljc | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software.
req... | Copyright ( c ) . All rights reserved .
Eclipse Public License 1.0 ( -1.0.php )
(ns cljs.pprint
(:refer-clojure :exclude [deftype #?(:cljs macroexpand)])
(:require [clojure.walk :as walk]
#?(:cljs [cljs.analyzer :as ana])))
replace .ppflush with -ppflush to switch from Interface to Protocol
... |
b804eb2c5e3a96a0ba404a9e9d3db063d8dee83b1f28c9038975de27a926f984 | weyrick/roadsend-php | php-proc.scm | ;; ***** BEGIN LICENSE BLOCK *****
Roadsend PHP Compiler Runtime Libraries
Copyright ( C ) 2007 Roadsend , Inc.
;;
;; 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 ; either version 2.... | null | https://raw.githubusercontent.com/weyrick/roadsend-php/d6301a897b1a02d7a85bdb915bea91d0991eb158/runtime/ext/standard/php-proc.scm | scheme | ***** BEGIN LICENSE BLOCK *****
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
either version 2.1
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MER... | Roadsend PHP Compiler Runtime Libraries
Copyright ( C ) 2007 Roadsend , Inc.
of the License , or ( at your option ) any later version .
GNU Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Public License
Foundation , Inc. , 51 Franklin Street , Fifth... |
d5bf3a07f95d75cc4fbf7f1f05dfc276180111fd38be61b00ca87a34904d6cd4 | samrocketman/home | balloon.scm | ; balloon
; creates a balloon like in comics
; it sucks a bit ;-)
( C ) Copyright 2000 by < >
;
Updated to Gimp2.4 ( 11 - 2007 )
;
;
(define (round-balloon img drawable bw bh rect np orientation revert lw)
(let* ((x 0))
(if (= np FALSE) (begin
(set! x (- (* bw 0.5) (* bw 0.2)))
(gimp-ellipse-select img x (* bh... | null | https://raw.githubusercontent.com/samrocketman/home/63a8668a71dc594ea9ed76ec56bf8ca43b2a86ca/dotfiles/.gimp/scripts/balloon.scm | scheme | balloon
creates a balloon like in comics
it sucks a bit ;-)
| ( C ) Copyright 2000 by < >
Updated to Gimp2.4 ( 11 - 2007 )
(define (round-balloon img drawable bw bh rect np orientation revert lw)
(let* ((x 0))
(if (= np FALSE) (begin
(set! x (- (* bw 0.5) (* bw 0.2)))
(gimp-ellipse-select img x (* bh 0.5) (* bw 0.4) (* bh 0.4) REPLACE TRUE FALSE 0)
(set! x (- (* bw 0.5) (... |
6a1f3df71f03d19eae5381a068e921b9e2f1cdfb7dcb1bb2824851344b91e19a | elastic/eui-cljs | eui_timeline_item_icon_styles.cljs | (ns eui.eui-timeline-item-icon-styles
(:require ["@elastic/eui/lib/components/timeline/timeline_item_icon.styles.js" :as eui]))
(def euiTimelineItemIconStyles eui/euiTimelineItemIconStyles)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/eui_timeline_item_icon_styles.cljs | clojure | (ns eui.eui-timeline-item-icon-styles
(:require ["@elastic/eui/lib/components/timeline/timeline_item_icon.styles.js" :as eui]))
(def euiTimelineItemIconStyles eui/euiTimelineItemIconStyles)
| |
b0bae480ae36ee5186053ede618f168d2538ffdf2a1d53c747b75bc316138d7c | sgbj/MaximaSharp | xerprn.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 46c1f6a93b0d 2012/05/03 04:40:28 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
;;; "f2cl5.l,v 46c1f6a93b0d 2012/05/03 04:40:28 toy $... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/src/numerical/slatec/xerprn.lisp | lisp | Compiled by f2cl version:
"f2cl5.l,v 46c1f6a93b0d 2012/05/03 04:40:28 toy $"
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':simple-array)
(:array-slicing nil) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 46c1f6a93b0d 2012/05/03 04:40:28 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl6.l , v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $ "
" macros.l , v fceac53... |
62df23ae57bef5cbdf32393acba314a9408d05be268872cdf23ebf316316797f | fulcrologic/fulcro-rad-kvstore | redis.cljc | (ns com.fulcrologic.rad.database-adapters.key-value.redis
(:require
[com.fulcrologic.rad.database-adapters.key-value.key-store :as kv-key-store]
[konserve-carmine.core :refer [new-carmine-store]]))
(defmethod kv-key-store/make-adaptor :redis
[_ {:redis/keys [uri]}]
[(str "Konserve Redis at " uri)
(new... | null | https://raw.githubusercontent.com/fulcrologic/fulcro-rad-kvstore/f0046c21e386214b42d4621b33dcb3aa1058ad52/src/redis/com/fulcrologic/rad/database_adapters/key_value/redis.cljc | clojure | (ns com.fulcrologic.rad.database-adapters.key-value.redis
(:require
[com.fulcrologic.rad.database-adapters.key-value.key-store :as kv-key-store]
[konserve-carmine.core :refer [new-carmine-store]]))
(defmethod kv-key-store/make-adaptor :redis
[_ {:redis/keys [uri]}]
[(str "Konserve Redis at " uri)
(new... | |
3e842b5a4ac5d877869653ca26d9642aaa26b374912ed4ef221a9f6454ffb4f7 | tolysz/prepare-ghcjs | SrcDist.hs | # LANGUAGE NondecreasingIndentation #
Implements the \"@.\/cabal sdist@\ " command , which creates a source
-- distribution for this package. That is, packs up the source code
into a tarball , making use of the corresponding Cabal module .
module Distribution.Client.SrcDist (
sdist,
allPackageSou... | null | https://raw.githubusercontent.com/tolysz/prepare-ghcjs/8499e14e27854a366e98f89fab0af355056cf055/spec-lts/cabal/cabal-install/Distribution/Client/SrcDist.hs | haskell | distribution for this package. That is, packs up the source code
|Create a source distribution.
'withTempDir' fails if we don't create 'tmpTargetDir'...
Run 'setup sdist --output-directory=tmpDir' (or
'--list-source'/'--output-directory=someOtherDir') in case we were passed
those options.
Unless we were given -... | # LANGUAGE NondecreasingIndentation #
Implements the \"@.\/cabal sdist@\ " command , which creates a source
into a tarball , making use of the corresponding Cabal module .
module Distribution.Client.SrcDist (
sdist,
allPackageSourceFiles
) where
import Distribution.Client.SetupWrapper
... |
328bfdf9a2ecf090bd41e7c2e0245ac8673c8d2d6391689359f41e279fbb609e | racket/typed-racket | deep-with-type.rkt | #lang typed/racket/base
;; neither id should be bound in t/r lang
(require syntax/macro-testing typed/rackunit)
(check-exn #rx"unbound identifier"
(lambda () (convert-compile-time-error with-type-shallow)))
(check-exn #rx"unbound identifier"
(lambda () (convert-compile-time-error with-type-optional)))
| null | https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/succeed/shallow/deep-with-type.rkt | racket | neither id should be bound in t/r lang | #lang typed/racket/base
(require syntax/macro-testing typed/rackunit)
(check-exn #rx"unbound identifier"
(lambda () (convert-compile-time-error with-type-shallow)))
(check-exn #rx"unbound identifier"
(lambda () (convert-compile-time-error with-type-optional)))
|
a64e5eed59cccd065064845f194aa2d0e47d38c8c530d841e3a329234e2966d1 | janestreet/async_rpc_kernel | test_connection.ml | open! Core
open! Async
(* Helpers for manipulating handshake types *)
open struct
module Header = Async_rpc_kernel.Async_rpc_kernel_private.Connection.For_testing.Header
let with_handshake_header header =
Async_rpc_kernel.Async_rpc_kernel_private.Connection.For_testing
.with_async_execution_context
... | null | https://raw.githubusercontent.com/janestreet/async_rpc_kernel/541fb417b39fad5c930ac73b729a7aaf59bd1001/test/test_connection.ml | ocaml | Helpers for manipulating handshake types
The overhead includes the tag, the query id, the version, empty metadata, and the
query construction, wrapped in the request/response records.
The overhead includes the tag, the query id, the version, and the query construction,
wrapped in the request/response rec... | open! Core
open! Async
open struct
module Header = Async_rpc_kernel.Async_rpc_kernel_private.Connection.For_testing.Header
let with_handshake_header header =
Async_rpc_kernel.Async_rpc_kernel_private.Connection.For_testing
.with_async_execution_context
~context:header
;;
end
let rpc_tag = "test_r... |
91965602f5fddf8f13c49134c033cfa6b2a835842219247902fe00ccb188c692 | billstclair/trubanc-lisp | compat.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : HUNCHENTOOT ; Base : 10 -*-
$ Header : /usr / local / cvsrep / hunchentoot / util.lisp , v 1.35 2008/04/08 14:39:18 edi Exp $
Copyright ( c ) 2004 - 2009 , Dr. . All rights reserved .
;;; Redistribution and use in source and binary forms, with or without
;;... | null | https://raw.githubusercontent.com/billstclair/trubanc-lisp/5436d2eca5b1ed10bc47eec7080f6cb90f98ca65/systems/hunchentoot-1.0.0/compat.lisp | lisp | Syntax : COMMON - LISP ; Package : HUNCHENTOOT ; Base : 10 -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and t... | $ Header : /usr / local / cvsrep / hunchentoot / util.lisp , v 1.35 2008/04/08 14:39:18 edi Exp $
Copyright ( c ) 2004 - 2009 , Dr. . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package :... |
a2ae3973765b5a53c2b666ce2ae2585bc099048ba1a38291231a9c44bfc77453 | fredlund/McErlang | mce_erl_node.erl | Copyright ( c ) 2009 ,
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions are met:
%% %% Redistributions of source code must retain the above copyright
%% notice, this list of conditions a... | null | https://raw.githubusercontent.com/fredlund/McErlang/25b38a38a729fdb3c3d2afb9be016bbb14237792/languages/erlang/src/mce_erl_node.erl | erlang | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
%% Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
%% Redi... | Copyright ( c ) 2009 ,
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR
@author
2006 - 2009
@private
-module(mce_erl_node).
-export([doDispatchSignal/2]).
-include("../../../src/include/mac... |
4c5a5430131bcac73e3bffa4a79aa43b373d93419c013c6995d6b469e932ec55 | jgm/gitit2 | Random.hs | module Network.Gitit2.Handler.Random (
getRandomR
) where
import Control.Monad (filterM)
import Data.FileStore (index)
import Network.Gitit2.Import
import System.Random (randomRIO)
getRandomR :: HasGitit master => GH master Html
getRandomR = do
fs <- filestore <$> getYesod
files <- liftIO $ index fs
pages <... | null | https://raw.githubusercontent.com/jgm/gitit2/db61eae0e17c356830979747e2899ac5eaad03a5/Network/Gitit2/Handler/Random.hs | haskell | module Network.Gitit2.Handler.Random (
getRandomR
) where
import Control.Monad (filterM)
import Data.FileStore (index)
import Network.Gitit2.Import
import System.Random (randomRIO)
getRandomR :: HasGitit master => GH master Html
getRandomR = do
fs <- filestore <$> getYesod
files <- liftIO $ index fs
pages <... | |
4f1295c08479c0a99d03338df14f1957ef176bbf5fc97ee9f0715fbe56ebfabc | shterrett/haskell-road | Chapter3Test.hs | module Chapter3Test where
import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..))
import Chapter3
import TestHelper (testCase)
productPlusOneTests :: [Test]
productPlusOneTests = [ testCase "returns the product of all primes less than prime + 1" $
7 @=? productPlusOne 5
... | null | https://raw.githubusercontent.com/shterrett/haskell-road/4af8253fc4475e5689b0ce59da468a3a6c92872e/test/Chapter3Test.hs | haskell | module Chapter3Test where
import Test.HUnit (Assertion, (@=?), runTestTT, Test(..), Counts(..))
import Chapter3
import TestHelper (testCase)
productPlusOneTests :: [Test]
productPlusOneTests = [ testCase "returns the product of all primes less than prime + 1" $
7 @=? productPlusOne 5
... | |
db4cfd0854a823fa104fe0da3794f3ffa7a4f3f7813be67b9b8d157d791dda25 | ndmitchell/catch | HeadReverse.hs |
module HeadReverse where
main x = head (reverse x)
| null | https://raw.githubusercontent.com/ndmitchell/catch/5d834416a27b4df3f7ce7830c4757d4505aaf96e/examples/Example/HeadReverse.hs | haskell |
module HeadReverse where
main x = head (reverse x)
| |
3307bd07b5e2db8eb17b65e0f11a343b7c6158931f3ca9c0f821b4d249d9daf6 | lsevero/abclj | project.clj | (defproject game-of-life "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:dependencies [[org.clojure/clojure "1.10.0"]
[abclj "0.1.3"]]
:aot :all
:main game-of-life.core
:... | null | https://raw.githubusercontent.com/lsevero/abclj/9f5a10aa98789a94f550b13d07e57b4fcefccfab/examples/game-of-life/project.clj | clojure | (defproject game-of-life "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:dependencies [[org.clojure/clojure "1.10.0"]
[abclj "0.1.3"]]
:aot :all
:main game-of-life.core
:... | |
69df6c8c247f932d74ab7102d19c067924ae5174dd6a192dbb5b3242f50ee268 | geneweb/geneweb | relationDisplay.ml | Copyright ( c ) 1998 - 2007 INRIA
open Config
open Def
open Gwdb
open Util
open Dag2html
open Relation
let dag_of_ind_dag_list indl =
let indl, _ =
List.fold_right
(fun ind (indl, cnt) -> ((ind, cnt) :: indl, cnt + 1))
indl ([], 0)
in
let idag_of_di_ind ind = idag_of_int (List.assq ind indl) i... | null | https://raw.githubusercontent.com/geneweb/geneweb/747f43da396a706bd1da60d34c04493a190edf0f/lib/relationDisplay.ml | ocaml | must be a bug
must be a bug
must be a bug
must be a bug
must be a bug
must be a bug
must be a bug
must be a bug | Copyright ( c ) 1998 - 2007 INRIA
open Config
open Def
open Gwdb
open Util
open Dag2html
open Relation
let dag_of_ind_dag_list indl =
let indl, _ =
List.fold_right
(fun ind (indl, cnt) -> ((ind, cnt) :: indl, cnt + 1))
indl ([], 0)
in
let idag_of_di_ind ind = idag_of_int (List.assq ind indl) i... |
426c110d136064e9e901d78f33991d5ac36401472ab35365a58af85790c60b3d | mirage/ptt | mti_gf.mli | * { 1 : A simple SMTP relay . }
This module implements a server which re - send incoming emails to their
real destinations ( including the { i map } which can alter destinations ) . For
instance , the relay - map can define that for an email to [ ] , the
real destination is [ ] .
This mo... | null | https://raw.githubusercontent.com/mirage/ptt/c4851958be6a3a98c5c267ae963e10cb41eb72e4/lib/mti_gf.mli | ocaml | * { 1 : A simple SMTP relay . }
This module implements a server which re - send incoming emails to their
real destinations ( including the { i map } which can alter destinations ) . For
instance , the relay - map can define that for an email to [ ] , the
real destination is [ ] .
This mo... | |
b1dd506091736a53d8467b00565bf5144551b6f19f3d88973f6a41f089650139 | kelseyq/clojure-twitter-bot | core.clj | (ns clojure-twitter-bot.core
(:use
[twitter.oauth]
[twitter.callbacks]
[twitter.callbacks.handlers]
[twitter.api.restful]
[twitter.api.streaming])
(:require
[clojure.data.json :as json]
[http.async.client :as ac]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.tools.l... | null | https://raw.githubusercontent.com/kelseyq/clojure-twitter-bot/8f77f949e7169bed771c221556d65766a5caf613/src/clojure_twitter_bot/core.clj | clojure | (ns clojure-twitter-bot.core
(:use
[twitter.oauth]
[twitter.callbacks]
[twitter.callbacks.handlers]
[twitter.api.restful]
[twitter.api.streaming])
(:require
[clojure.data.json :as json]
[http.async.client :as ac]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.tools.l... | |
2c2229c995f3b6c8902f31d3c863ee437ffefd29afa176a69d6c69e73db6461c | jiangpengnju/htdp2e | ex155.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-beginner-reader.ss" "lang")((modname ex155) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f ... | null | https://raw.githubusercontent.com/jiangpengnju/htdp2e/d41555519fbb378330f75c88141f72b00a9ab1d3/arbitrarily-large-data/designing-with-self-referential-data-dafinitions/ex155.rkt | racket | about the language level of this file in a form that our tools can easily process.
of all colors, sperate by a comma and a space.
Thus our example should produce "yellow, green, red".
doll that its color is "red" and the doll inside is inside-doll.
- String
RD -> String
computes a string of all colors of a give... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex155) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
Design the function colors . It consumes a Russian doll and prod... |
5e8e54d0f5f2659324d9711205ef8d0eb82a1d8adc416037b33f29d4db66c975 | christiaanb/DE1-Cyclone-II-FPGA-Board-Support-Package | BusCtrl.hs | # LANGUAGE RecordWildCards #
module I2C.BitMaster.BusCtrl where
import CLaSH.Prelude
import Control.Lens
import Control.Monad.State
import I2C.BitMaster.StateMachine
import I2C.Types
data BusStatusCtrl
= BusStatusCtrl
synchronized SCL and SDA
, _dI2C :: I2CIn -- delayed sI2C
, _al ... | null | https://raw.githubusercontent.com/christiaanb/DE1-Cyclone-II-FPGA-Board-Support-Package/4f816856bcda122b5a93a05e99bbab9a5c0e51d2/I2C/BitMaster/BusCtrl.hs | haskell | delayed sI2C
internal arbitration lost signal
clock divider for filter
start detected
stop detected
internal busy signal
STOP command
delayed sI2C
internal arbitration lost signal
clock divider for filter
start detected
stop detected
internal busy signal
STOP command
i2c busy signal
generate arbitration... | # LANGUAGE RecordWildCards #
module I2C.BitMaster.BusCtrl where
import CLaSH.Prelude
import Control.Lens
import Control.Monad.State
import I2C.BitMaster.StateMachine
import I2C.Types
data BusStatusCtrl
= BusStatusCtrl
synchronized SCL and SDA
capture SCL and SDA
filter input for SCL and SDA
}
makeLenses '... |
c5ce01e904de345a3f64f477a6aef93339fd92ac13a0d3fecfc5d957b7c924f4 | SNePS/SNePS2 | path.lisp | -*- Mode : Lisp ; Syntax : Common - Lisp ; Package : SNEPS ; Base : 10 -*-
Copyright ( C ) 1984 - -2013 Research Foundation of
;; State University of New York
Version : $ I d : path.lisp , v 1.2 2013/08/28 19:07:25 shapiro Exp $
;; This file is part of SNePS.
$ BEGIN LICENSE$
The... | null | https://raw.githubusercontent.com/SNePS/SNePS2/d3862108609b1879f2c546112072ad4caefc050d/sneps/ds/path.lisp | lisp | Syntax : Common - Lisp ; Package : SNEPS ; Base : 10 -*-
State University of New York
This file is part of SNePS.
you may
not use this file except in compliance with the License. You
may obtain a copy of the License at
. edu/sneps/Downloads/ubpl.pdf.
or implied. See the License for t... |
Copyright ( C ) 1984 - -2013 Research Foundation of
Version : $ I d : path.lisp , v 1.2 2013/08/28 19:07:25 shapiro Exp $
$ BEGIN LICENSE$
The contents of this file are subject to the University at
Software distributed under the License is distributed on an
" AS IS " basis , WITHOUT WARRANTY OF ANY KIN... |
481bcf818ea7f63255388b0e80d46884f42ee666d9ca0a480756d471d70e2ba3 | ott-lang/ott | substs_pp.ml | (**************************************************************************)
(* Ott *)
(* *)
, Computer Laboratory , University of Cambridge
, project , I... | null | https://raw.githubusercontent.com/ott-lang/ott/bd89321aeb74a1d35e9e6462486855fedd9e6064/src/substs_pp.ml | ocaml | ************************************************************************
Ott
... | , Computer Laboratory , University of Cambridge
, project , INRIA Rocquencourt
Copyright 2005 - 2010
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the ... |
dc1784bea0a56b175fa4f00e57c6bfd6c04039cbf448eda54656bbb07219d8ae | herbelin/coq-hh | inductiveops.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/herbelin/coq-hh/296d03d5049fea661e8bdbaf305ed4bf6d2001d2/pretyping/inductiveops.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* Return type as quoted by the user ... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
open Dec... |
7e55a4032017c61bbb6475a1f8abd1be8e2a774d90879317ae8a5b3f650f04d8 | drlivingston/kabob | hgnc_id_typing_rules.clj | ;; HGNC ids are of type kiao/DNAIdentifier
`{:name "hgnc-id-type-assertion"
:head ((?/ice kiao/denotesSubClassOf obo/SO_0000352)) ;dna
:body ((_/f kiao/hasTemplate iaohgnc/HgncDownloadFileData_hgncIDDataField1)
(_/f obo/IAO_0000219 ?/ice))}
`{:name "hgnc-symbol-type-assertion"
:head ((?/ice kiao/denotesSu... | null | https://raw.githubusercontent.com/drlivingston/kabob/7038076849744c959da9c8507e8a8ab7215410aa/kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/id_typing/hgnc_id_typing_rules.clj | clojure | HGNC ids are of type kiao/DNAIdentifier
dna
dna | `{:name "hgnc-id-type-assertion"
:body ((_/f kiao/hasTemplate iaohgnc/HgncDownloadFileData_hgncIDDataField1)
(_/f obo/IAO_0000219 ?/ice))}
`{:name "hgnc-symbol-type-assertion"
:body ((_/f kiao/hasTemplate
iaohgnc/HgncDownloadFileData_hgncGeneSymbolDataField1)
(_/f obo/IAO_0000219 ?/... |
2d617e07bcfb33e5e60d67241e15979bd44e7451f5f6923cf291f1eae14285a3 | scalaris-team/scalaris | type_check_SUITE.erl | 2012 - 2016 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
di... | null | https://raw.githubusercontent.com/scalaris-team/scalaris/feb894d54e642bb3530e709e730156b0ecc1635f/test/type_check_SUITE.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | 2012 - 2016 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 < >
@author < >
@author < >
-module(type_check_SUITE).
-author('').
-vsn('$Id$').
-compile(export_all).
-incl... |
d742d997b9dec0d124d1768b80a5e06dea3a82bd720f82fd700f4e2ff816d226 | spawnfest/eep49ers | ssl_crl_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2020 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/ssl/test/ssl_crl_SUITE.erl | erlang |
%CopyrightBegin%
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 lan... | Copyright Ericsson AB 2008 - 2020 . 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(ssl_crl_SUITE).
-behaviour(ct_suite).
-include_lib("common_test/include/ct.hrl").
-include_lib("public_key... |
e274eaf809001972b0a3204471443e44ccc23771182d9a2096f4987f80746682 | Frama-C/Frama-C-snapshot | options.mli | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/variadic/options.mli | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
b8dd6c1368bb25c0db49c9782c67c3e94ffa17b3f208c8fc68da9108f142809a | tonsky/datascript | parser_find.cljc | (ns datascript.test.parser-find
(:require
#?(:cljs [cljs.test :as t :refer-macros [is are deftest testing]]
:clj [clojure.test :as t :refer [is are deftest testing]])
[datascript.core :as d]
[datascript.db :as db]
[datascript.parser :as dp]
[datascript.test.core :as tdc]))
#?(:c... | null | https://raw.githubusercontent.com/tonsky/datascript/4f1af628d5650e0ca0ffd0b6b384941eef2c37fb/test/datascript/test/parser_find.cljc | clojure | (ns datascript.test.parser-find
(:require
#?(:cljs [cljs.test :as t :refer-macros [is are deftest testing]]
:clj [clojure.test :as t :refer [is are deftest testing]])
[datascript.core :as d]
[datascript.db :as db]
[datascript.parser :as dp]
[datascript.test.core :as tdc]))
#?(:c... | |
6112507b39a372d0033f25e8566392974b5d2f12df5a2d8e584171cfc7ff1551 | yetibot/core | default_command.clj | (ns yetibot.core.commands.default-command
"The default, configurable fallback command when no other command matches. Any
args will be appended to the end of the command."
(:require
[yetibot.core.models.default-command :refer [configured-default-command]]
[yetibot.core.hooks :refer [cmd-hook]]))
(defn sh... | null | https://raw.githubusercontent.com/yetibot/core/e35cc772622e91aec3ad7f411a99fff09acbd3f9/src/yetibot/core/commands/default_command.clj | clojure | (ns yetibot.core.commands.default-command
"The default, configurable fallback command when no other command matches. Any
args will be appended to the end of the command."
(:require
[yetibot.core.models.default-command :refer [configured-default-command]]
[yetibot.core.hooks :refer [cmd-hook]]))
(defn sh... | |
45ec4364ed24f576627a74f4f8246ee566bbfca3591f9359aeea5a745e573c02 | egobrain/tq_transform | db_types.erl | -module(db_types).
-compile({parse_transform, tq_record_transform}).
-define(FIELD(NAME, TYPE), -field({NAME, [{type, TYPE}]})).
?FIELD(binary_field, binary).
?FIELD(non_empty_binary_field, non_empty_binary).
?FIELD(non_neg_integer_field, non_neg_integer).
?FIELD(non_neg_float_field, non_neg_float).
?FIELD(integer_fi... | null | https://raw.githubusercontent.com/egobrain/tq_transform/6729f12b1a2fa5ece41ebb15b716c7f8b9360a33/test/src/db_types.erl | erlang | -module(db_types).
-compile({parse_transform, tq_record_transform}).
-define(FIELD(NAME, TYPE), -field({NAME, [{type, TYPE}]})).
?FIELD(binary_field, binary).
?FIELD(non_empty_binary_field, non_empty_binary).
?FIELD(non_neg_integer_field, non_neg_integer).
?FIELD(non_neg_float_field, non_neg_float).
?FIELD(integer_fi... | |
b476538c626ee39b0f65ed6ed619b2d76d7143c5f20ab1b847a5e56a53505338 | inclojure-org/intermediate-clojure-workshop | sqlite.clj | (ns workshop-app.db.sqlite
(:refer-clojure :rename {update cc-update
read cc-read})
(:import (java.sql DriverManager Connection PreparedStatement)))
;; Connection conn = DriverManager.getConnection("jdbc:sqlite:prod_database_1.sqlite");
(defn init-conn!
[conn-string]
(DriverManager/g... | null | https://raw.githubusercontent.com/inclojure-org/intermediate-clojure-workshop/3338a476aa815a587fa9e0b8b3804aa43492d15e/save-points/8/src/workshop_app/db/sqlite.clj | clojure | Connection conn = DriverManager.getConnection("jdbc:sqlite:prod_database_1.sqlite");
Statement statement = conn.createStatement();
statement.close()
String k, v;
Statement statement = conn.prepareStatement("insert into person values(?,?)");
statement.setString(1, k);
statement.executeUpdate();
statement.close... | (ns workshop-app.db.sqlite
(:refer-clojure :rename {update cc-update
read cc-read})
(:import (java.sql DriverManager Connection PreparedStatement)))
(defn init-conn!
[conn-string]
(DriverManager/getConnection conn-string))
(def conn (init-conn! "jdbc:sqlite:prod_database_1.sqlite"))... |
b24e0a4cbbf2e838a0ce501eecfa58075b33ac14137f11617bdb4c132203d8ce | rubenbarroso/EOPL | 5_7.scm | We use the following auxiliary method defined in 5-4-4.scm
(define class-name->super-name
(lambda (class-name)
(class->super-name (lookup-class class-name))))
;When we find and apply a method, we calculate the super-name from the host-name
(super-call-exp (method-name rands)
(let ((args (eval-rands rands env))... | null | https://raw.githubusercontent.com/rubenbarroso/EOPL/f9b3c03c2fcbaddf64694ee3243d54be95bfe31d/src/chapter5/5_7.scm | scheme | When we find and apply a method, we calculate the super-name from the host-name
storing host-name instead of super-name | We use the following auxiliary method defined in 5-4-4.scm
(define class-name->super-name
(lambda (class-name)
(class->super-name (lookup-class class-name))))
(super-call-exp (method-name rands)
(let ((args (eval-rands rands env))
(obj (apply-env env 'self))
(super-name (class-name->super-name
... |
bba57d41a27089aa9c7108e95692349d81e7a484a512b7f646ffcaf3f171b01f | funimagej/fun.imagej | utils.clj | (ns fun.imagej.segmentation.utils
(:require [clojure.string :as string])
(:import [ij.measure ResultsTable]))
(defn get-results-table
"Return the current results table."
[]
^ResultsTable (ResultsTable/getResultsTable))
(defn results-table-to-map
"Convert a results table into a hash map."
[rt]
(let [;r... | null | https://raw.githubusercontent.com/funimagej/fun.imagej/dcbe14581ba9394d8ecc6e254e02fac8130a942d/src/fun/imagej/segmentation/utils.clj | clojure | rt (get-results-table) | (ns fun.imagej.segmentation.utils
(:require [clojure.string :as string])
(:import [ij.measure ResultsTable]))
(defn get-results-table
"Return the current results table."
[]
^ResultsTable (ResultsTable/getResultsTable))
(defn results-table-to-map
"Convert a results table into a hash map."
[rt]
he... |
d67cabec68c8d9ff1d279cbd4384f206384e970c50fa42c5fce05287ad6f0fe0 | danr/hipspec | Integer.hs | module Integer where
fac :: Integer -> Integer
fac 0 = 0
fac n = n * fac (n - 1)
| null | https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/tfp1/tests/does_fail/Integer.hs | haskell | module Integer where
fac :: Integer -> Integer
fac 0 = 0
fac n = n * fac (n - 1)
| |
f2e3b54a408f97082e4725de7361118f6c4eea2864bd782ea155b5a92f3edcb5 | tud-fop/vanda-haskell | DyckLanguages.hs | |
Module : . . DyckLanguages
Description : functions to work with /Dyck languages/ languages
Copyright : Ⓒ , 2015
License : BSD - style
Maintainer :
Stability : experimental
This module contains functions to work with /Dyck languages/.
Module: Vanda.Dyck.DyckLanguages
Descr... | null | https://raw.githubusercontent.com/tud-fop/vanda-haskell/3214966361b6dbf178155950c94423eee7f9453e/library/Vanda/Dyck/DyckLanguages.hs | haskell | * Dyck language generator
| Checks whether a string is well-bracketed.
pushdown storage.
^ list of left parentheses
^ list of right parentheses
^ word whose membership is in question
^ left parentheses
^ right parentheses mapping
| If the 'L.List' has an /n/-th element /e/, return 'Just' /e/ otherwise
ret... | |
Module : . . DyckLanguages
Description : functions to work with /Dyck languages/ languages
Copyright : Ⓒ , 2015
License : BSD - style
Maintainer :
Stability : experimental
This module contains functions to work with /Dyck languages/.
Module: Vanda.Dyck.DyckLanguages
Descr... |
fc8149cff1bdf8e6376f73b07944b22e0c8904a69636a1f6d4c7ab8d90e1e105 | kongra/rete | Net.hs | # LANGUAGE Trustworthy #
------------------------------------------------------------------------
-- |
-- Module : AI.Rete.Net
Copyright : ( c ) 2015
-- License : BSD-style (see the file LICENSE)
Created : 2015 - 03 - 05
-- Maintainer :
-- Stability : experimental
----------------------------... | null | https://raw.githubusercontent.com/kongra/rete/e0b81f49bcd71b22646b36c92423bc9196aae935/AI/Rete/Net.hs | haskell | ----------------------------------------------------------------------
|
Module : AI.Rete.Net
License : BSD-style (see the file LICENSE)
Maintainer :
Stability : experimental
----------------------------------------------------------------------
* Adding productions
* Creating conditions
* Variable... | # LANGUAGE Trustworthy #
Copyright : ( c ) 2015
Created : 2015 - 03 - 05
module AI.Rete.Net
(
addProd
, addProdP
, C()
, c
, val
, valE
, valM
, StepStrategy
, breadthFirst
, depthFirst
, forwardChain
, exec
, execIO
, acompose
, passA... |
c08553c4f8044a2ab64fe7703b4bef3393acd68643659da78867778ae6e46ff5 | unnohideyuki/bunny | sample264.hs | main = do print $ words "ab cde fgh i jk"
putStrLn $ unwords ["abcd", "efgh"]
| null | https://raw.githubusercontent.com/unnohideyuki/bunny/501856ff48f14b252b674585f25a2bf3801cb185/compiler/test/samples/sample264.hs | haskell | main = do print $ words "ab cde fgh i jk"
putStrLn $ unwords ["abcd", "efgh"]
| |
877a25a7d6e740b5dfd4dfc3724be127964085bf1ad0f8c298c6c6bbcb590b74 | josephwilk/stereotype | t_stereotypes.clj | (ns stereotype.unit.t-stereotypes
(:use
[midje.sweet]
[stereotype.stereotypes]))
(facts "stereotype-fn"
(fact "returns attributes specified with"
((stereotype-fn {:x 2})) => {:x 2})
(fact "takes an argument that is merged with orignal attributes"
((stereotype-fn {:x 2 :y 1}) {:y 2}) => {... | null | https://raw.githubusercontent.com/josephwilk/stereotype/49c845ec7e5b401f5cd6c6e8de6c79fbe60eade8/test/stereotype/unit/t_stereotypes.clj | clojure | (ns stereotype.unit.t-stereotypes
(:use
[midje.sweet]
[stereotype.stereotypes]))
(facts "stereotype-fn"
(fact "returns attributes specified with"
((stereotype-fn {:x 2})) => {:x 2})
(fact "takes an argument that is merged with orignal attributes"
((stereotype-fn {:x 2 :y 1}) {:y 2}) => {... | |
e76ddefdd8c2a8c0c238791318bad267edebec0e83aeea7a689ab0b6b2eae1d8 | isovector/suavemente | Input.hs | # LANGUAGE ApplicativeDo #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE QuasiQuotes #-}
# OPTIONS_GHC -Wall #
module Web.Suavemente.Input where
import Control.Arrow ((&&&))
import Control.Concurrent.STM.TVar (newTVar, readTVar)
import Control.Monad.State.Class (MonadState (..), modify... | null | https://raw.githubusercontent.com/isovector/suavemente/b74315d57c42192353d6c5b67a13c3cf64d6afa3/src/Web/Suavemente/Input.hs | haskell | # LANGUAGE QuasiQuotes #
----------------------------------------------------------------------------
| Generate a new name for an HTML element.
----------------------------------------------------------------------------
| Constructor for building 'Suave' inputs that are backed by HTML elements.
^ The input's ... | # LANGUAGE ApplicativeDo #
# LANGUAGE FlexibleContexts #
# OPTIONS_GHC -Wall #
module Web.Suavemente.Input where
import Control.Arrow ((&&&))
import Control.Concurrent.STM.TVar (newTVar, readTVar)
import Control.Monad.State.Class (MonadState (..), modify)
import Control.Monad.T... |
92cf060e0dfddcd236099632440be44685638828df8f20b16c8df9c4cc8859c1 | kronkltd/jiksnu | activity_routes_test.clj | (ns jiksnu.modules.web.routes.activity-routes-test
(:require [clj-factory.core :refer [fseq]]
[clojure.data.json :as json]
[jiksnu.mock :as mock]
[jiksnu.modules.core.model.activity :as model.activity]
jiksnu.modules.web.routes.activity-routes
[jiksnu.helper... | null | https://raw.githubusercontent.com/kronkltd/jiksnu/8c91e9b1fddcc0224b028e573f7c3ca2f227e516/test/jiksnu/modules/web/routes/activity_routes_test.clj | clojure | (ns jiksnu.modules.web.routes.activity-routes-test
(:require [clj-factory.core :refer [fseq]]
[clojure.data.json :as json]
[jiksnu.mock :as mock]
[jiksnu.modules.core.model.activity :as model.activity]
jiksnu.modules.web.routes.activity-routes
[jiksnu.helper... | |
2045e1e4fc6ab9eb67a816adb92b4b59fdada09869adf814da630bd096b7d74f | eeng/shevek | middleware.clj | (ns shevek.monitoring.middleware
(:require [influxdb-clojure.core :as influxdb]
[mount.core :refer [defstate]]
[shevek.config :refer [config]]))
(defstate conn
:start (when-let [{:keys [uri username password]} (config [:monitoring :influx])]
(influxdb/connect uri username passwor... | null | https://raw.githubusercontent.com/eeng/shevek/7783b8037303b8dd5f320f35edee3bfbb2b41c02/src/clj/shevek/monitoring/middleware.clj | clojure | Add the duration to the response so the logging middleware can use it | (ns shevek.monitoring.middleware
(:require [influxdb-clojure.core :as influxdb]
[mount.core :refer [defstate]]
[shevek.config :refer [config]]))
(defstate conn
:start (when-let [{:keys [uri username password]} (config [:monitoring :influx])]
(influxdb/connect uri username passwor... |
917908e7821f29183a4b2346f26e735e9823502f5004b7bfb77ab088b4ecdca2 | glebec/haskell-programming-allen-moronuki | Main.hs | module Main where
import BadMonoid (checkBadMonoid, checkAppSSI)
import Ex17_8A_ZipList
import Ex17_8B_List (checkList)
import Ex17_8C_ZipList (checkZipList)
import Ex17_8D_Validation (checkValidation)
import Ex17_9A ( checkPair
, checkTwo
, checkThree
, checkThree'
... | null | https://raw.githubusercontent.com/glebec/haskell-programming-allen-moronuki/99bd232f523e426d18a5e096f1cf771228c55f52/17-applicative/exercises/src/Main.hs | haskell | module Main where
import BadMonoid (checkBadMonoid, checkAppSSI)
import Ex17_8A_ZipList
import Ex17_8B_List (checkList)
import Ex17_8C_ZipList (checkZipList)
import Ex17_8D_Validation (checkValidation)
import Ex17_9A ( checkPair
, checkTwo
, checkThree
, checkThree'
... | |
937851db4a25dc35151f450db2b09825fb92440bc21c0bf23b76366b25b9bae0 | mbutterick/beautiful-racket | parser.rkt | #lang brag
b-program : [b-line] (/NEWLINE [b-line])*
b-line : b-line-num [b-statement] (/":" [b-statement])* [b-rem]
@b-line-num : INTEGER
b-rem : REM
@b-statement : b-end | b-print | b-goto
| b-let | b-input | b-if
| b-gosub | b-return | b-for | b-next
b-end : /"end"
b-print : /"print" [b-pri... | null | https://raw.githubusercontent.com/mbutterick/beautiful-racket/f0e2cb5b325733b3f9cbd554cc7d2bb236af9ee9/beautiful-racket-demo/basic-demo-2/parser.rkt | racket | #lang brag
b-program : [b-line] (/NEWLINE [b-line])*
b-line : b-line-num [b-statement] (/":" [b-statement])* [b-rem]
@b-line-num : INTEGER
b-rem : REM
@b-statement : b-end | b-print | b-goto
| b-let | b-input | b-if
| b-gosub | b-return | b-for | b-next
b-end : /"end"
b-print : /"print" [b-pri... | |
befb36b763ae9cf30ad34d831faaac86797b9a11de9262c6b0a78f70c1c5ed66 | tnelson/Forge | circular.rkt | #lang forge
sig B { }
sig A { b: set B }
pred main { some A }
run main for exactly 4 A | null | https://raw.githubusercontent.com/tnelson/Forge/1687cba0ebdb598c29c51845d43c98a459d0588f/forge/examples/circular.rkt | racket | #lang forge
sig B { }
sig A { b: set B }
pred main { some A }
run main for exactly 4 A | |
454cfcbada61a22b4d9d7ed57723203d1ebb0293f1ff4ea7dabcb528f89ae997 | clojupyter/clojupyter | execute.clj | (ns clojupyter.kernel.handle-event.execute
(:require [clojupyter.kernel.cljsrv :as cljsrv]
[clojupyter.kernel.handle-event.ops :as ops
:refer [definterceptor s*append-enter-action s*append-leave-action]]
[clojupyter.kernel.jup-channels :refer [receive!! send!!]]
[cloju... | null | https://raw.githubusercontent.com/clojupyter/clojupyter/02f8df359bc67264703c23f37ad0707d2871c76a/src/clojupyter/kernel/handle_event/execute.clj | clojure | ------------------------------------------------------------------------------------------------------------------------
STATE OPS
------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------... | (ns clojupyter.kernel.handle-event.execute
(:require [clojupyter.kernel.cljsrv :as cljsrv]
[clojupyter.kernel.handle-event.ops :as ops
:refer [definterceptor s*append-enter-action s*append-leave-action]]
[clojupyter.kernel.jup-channels :refer [receive!! send!!]]
[cloju... |
d0fde48242f4d24c84bac2051e6a52ac52a37335e990ddc52757f297009d8521 | tchoutri/pg-entity | Tutorial.hs | -- ## pg-entity tutorial
-- In this tutorial, you will learn how to implement the Entity typeclass for your business logic data-types, and run
-- queries against the database.
--
# # # Setting up
# # # # Language Extensions
--
* ` OverloadedLists ` allow us to use the ` [ list ] ` syntax for datatypes other than ... | null | https://raw.githubusercontent.com/tchoutri/pg-entity/49507eeae777623462c69e2d387c684934817c4c/docs/src/Tutorial.hs | haskell | ## pg-entity tutorial
In this tutorial, you will learn how to implement the Entity typeclass for your business logic data-types, and run
queries against the database.
* `QuasiQuotes` enable us to write plain SQL and field names in a `[|quasi-quoter block|]`.
* The Deriving extensions give us more powerful typecl... | # # # Setting up
# # # # Language Extensions
* ` OverloadedLists ` allow us to use the ` [ list ] ` syntax for datatypes other than List , like Vector .
# LANGUAGE DerivingVia #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE OverloadedLists #
# LANGUAGE QuasiQuotes #
module Tutorial where
import Data.Pool (... |
a3bde0adcbbb940b361e13a8f86ba60a37aff159607c06231976c21540c53b9a | plow-technologies/servant-streaming | Internal.hs | # OPTIONS_GHC -fno - warn - orphans #
module Servant.Streaming.Docs.Internal where
import Control.Lens
import Data.Proxy (Proxy (Proxy))
import Servant.API hiding (Stream)
import Servant.API.ContentTypes (allMime, AllMime)
import GHC.TypeLit... | null | https://raw.githubusercontent.com/plow-technologies/servant-streaming/d3c16ea26e773355d0eb8af996e80d1e94bc859b/servant-streaming-docs/src/Servant/Streaming/Docs/Internal.hs | haskell | # OPTIONS_GHC -fno - warn - orphans #
module Servant.Streaming.Docs.Internal where
import Control.Lens
import Data.Proxy (Proxy (Proxy))
import Servant.API hiding (Stream)
import Servant.API.ContentTypes (allMime, AllMime)
import GHC.TypeLit... | |
1e767488b00c7ca868a2c1d2983f4f21b7e182052332c70e0a8eaeadc1d4a7c9 | waddlaw/TAPL | FJ.hs | module Language.FJ
( module Language.FJ.Example,
module Language.FJ.Eval,
module Language.FJ.Parser,
module Language.FJ.Type,
run,
runAll,
debug,
)
where
import Language.FJ.Eval
import Language.FJ.Example
import Language.FJ.Parser
import Language.FJ.Pretty
import Language.FJ.Type
import RIO... | null | https://raw.githubusercontent.com/waddlaw/TAPL/94576e46821aaf7abce6d1d828fc3ce6d05a40b8/subs/featherweight-java/src/Language/FJ.hs | haskell | module Language.FJ
( module Language.FJ.Example,
module Language.FJ.Eval,
module Language.FJ.Parser,
module Language.FJ.Type,
run,
runAll,
debug,
)
where
import Language.FJ.Eval
import Language.FJ.Example
import Language.FJ.Parser
import Language.FJ.Pretty
import Language.FJ.Type
import RIO... | |
239557ef7690d208743007c5da6392b73e3f186da4fde8e3c22d6ca1ab102268 | aiya000/haskell-examples | lex.hs | # LANGUAGE ViewPatterns #
import Test.QuickCheck (quickCheck)
lexTest :: String -> Bool
lexTest = (<=1) . length . lex
main :: IO ()
main = do
print $ lex "abc123 abc 123"
print $ lex "abc 123"
print $ lex "123"
print $ lex ""
quickCheck lexTest
-- {output}
[ ( " abc123 " , " abc 123 " ) ]
[ ( " abc " ... | null | https://raw.githubusercontent.com/aiya000/haskell-examples/a337ba0e86be8bb1333e7eea852ba5fa1d177d8a/Prelude/lex.hs | haskell | {output}
[("","")] | # LANGUAGE ViewPatterns #
import Test.QuickCheck (quickCheck)
lexTest :: String -> Bool
lexTest = (<=1) . length . lex
main :: IO ()
main = do
print $ lex "abc123 abc 123"
print $ lex "abc 123"
print $ lex "123"
print $ lex ""
quickCheck lexTest
[ ( " abc123 " , " abc 123 " ) ]
[ ( " abc " , " 123 " ) ... |
fdc37901555857a63db584abbb1f8dd0896bbd1b7f9efc6425625cadf18210c6 | zenspider/schemers | exercise.4.78.scm | #!/usr/bin/env csi -s
(require rackunit)
Exercise 4.78
;; Redesign the query language as a nondeterministic
;; program to be implemented using the evaluator of section *Note
4 - 3 : : , rather than as a stream process . In this approach , each
;; query will produce a single answer (rather than the stream of al... | null | https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_4/exercise.4.78.scm | scheme | Redesign the query language as a nondeterministic
program to be implemented using the evaluator of section *Note
query will produce a single answer (rather than the stream of all
answers) and the user can type `try-again' to see more answers.
You should find that much of the mechanism we built in this
section is ... | #!/usr/bin/env csi -s
(require rackunit)
Exercise 4.78
4 - 3 : : , rather than as a stream process . In this approach , each
|
fbb93f9c08f588a99efd3d2c0e153a0e6c7d336fd6b638124ff5c7e4e82bfdf9 | giorgidze/YampaSynth | SynthBasics.hs | {-# LANGUAGE Arrows #-}
module SynthBasics (
oscSine
, oscSine'
, amp
, envGen
, oscSampleBased
, mixer
, moogVCF
, CV
, Frequency
, Resonance
) where
import FRP.Yampa
import Data.Audio hiding (sampleRate)
import Codec.Midi hiding (Time)
import SynthParams
type CV = Double
type Frequency = Do... | null | https://raw.githubusercontent.com/giorgidze/YampaSynth/a262eeb735c80845868f905cbebde01ac47b9cfd/src/SynthBasics.hs | haskell | # LANGUAGE Arrows #
0 - 1 |
module SynthBasics (
oscSine
, oscSine'
, amp
, envGen
, oscSampleBased
, mixer
, moogVCF
, CV
, Frequency
, Resonance
) where
import FRP.Yampa
import Data.Audio hiding (sampleRate)
import Codec.Midi hiding (Time)
import SynthParams
type CV = Double
type Frequency = Double
oscSine :: Frequen... |
2982f79f9c37b3453128a3539d3e6b95eaffe8a038ae3a6d0401956f19b26b1c | xlevus/reframe-sente | prod.cljs | (ns demo.prod
(:require [demo.core :as core]))
;;ignore println statements in prod
(set! *print-fn* (fn [& _]))
(core/init!)
| null | https://raw.githubusercontent.com/xlevus/reframe-sente/a338816c82c9f1165134ecd5a17e0d4d088e24f0/env/prod/cljs/demo/prod.cljs | clojure | ignore println statements in prod | (ns demo.prod
(:require [demo.core :as core]))
(set! *print-fn* (fn [& _]))
(core/init!)
|
08b094282a646e6be1e184f3190cad2c8936fa4ab92836aa3dd5b3346c54f33b | ucsd-progsys/liquid-fixpoint | Sanitize.hs | -- | Validate and Transform Constraints to Ensure various Invariants -------------------------
-- 1. Each binder must be associated with a UNIQUE sort
# LANGUAGE TupleSections #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternGuards #-}
{-# OPTIONS_GHC -Wno-name-shadowing #-}
module Language.Fixpoin... | null | https://raw.githubusercontent.com/ucsd-progsys/liquid-fixpoint/021d7af56a39985170c78b07c842b853a6180f77/src/Language/Fixpoint/Solver/Sanitize.hs | haskell | | Validate and Transform Constraints to Ensure various Invariants -------------------------
1. Each binder must be associated with a UNIQUE sort
# LANGUAGE OverloadedStrings #
# LANGUAGE PatternGuards #
# OPTIONS_GHC -Wno-name-shadowing #
* Transform FInfo to enforce invariants
* Sorts for each Symbol (move e... | # LANGUAGE TupleSections #
module Language.Fixpoint.Solver.Sanitize
sanitize
, symbolEnv
* Remove substitutions : = e ] where ` x ` is not in dom(K )
, dropDeadSubsts
) where
import Language.Fixpoint.Types.PrettyPrint
import Language.Fixpoint.Types.Visitor
import Lan... |
698a7b2a2800af77b92584383dd16cd2e1c8dfa9fbd954e8755f0f04030dd1f1 | mirage/irmin | version.ml |
* Copyright ( c ) 2013 - 2022 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... | null | https://raw.githubusercontent.com/mirage/irmin/abeee121a6db7b085b3c68af50ef24a8d8f9ed05/src/irmin/version.ml | ocaml |
* Copyright ( c ) 2013 - 2022 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.