_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 |
|---|---|---|---|---|---|---|---|---|
e0b16c7fc41edf28ddb13791c405a24543843cbf5c9fa7d4a40c5d3bb1b32fa8 | borkdude/glam | impl.clj | (ns glam.impl.impl
{:no-doc true}
(:require [clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.java.shell :refer [sh]]
[clojure.string :as str])
(:import [java.net URL HttpURLConnection]
[java.nio.file Files]))
(set! *warn-on-reflection* true)
(defn normalize-... | null | https://raw.githubusercontent.com/borkdude/glam/b1d59a5c67aa6ca1e5d04340d4b1c0bc60e8c6a6/src/glam/impl/impl.clj | clojure | Template fallback
TODO: error handling
Package creation | (ns glam.impl.impl
{:no-doc true}
(:require [clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.java.shell :refer [sh]]
[clojure.string :as str])
(:import [java.net URL HttpURLConnection]
[java.nio.file Files]))
(set! *warn-on-reflection* true)
(defn normalize-... |
04d7f10ec3f7b25c5db38677d295e6d227206f6543c8f830592c464647eb2bd4 | simedw/Kandidat | Types.hs | {-# LANGUAGE PackageImports #-}
module Stg.Types where
import "mtl" Control.Monad.State
import "mtl" Control.Monad.Writer
import Data.Map(Map)
import qualified Data.Map as M
import Stg.AST
import Stg.Rules
import Stg.Stack
import Stg.Heap
import qualified Stg.Heap as H
data Cont t
= CtCase [Branch t]
| CtU... | null | https://raw.githubusercontent.com/simedw/Kandidat/fbf68edf5b003aba2ce13dac32ee1b94172d57d8/src/Stg/Types.hs | haskell | # LANGUAGE PackageImports #
| Create a fresh unbound variable | module Stg.Types where
import "mtl" Control.Monad.State
import "mtl" Control.Monad.Writer
import Data.Map(Map)
import qualified Data.Map as M
import Stg.AST
import Stg.Rules
import Stg.Stack
import Stg.Heap
import qualified Stg.Heap as H
data Cont t
= CtCase [Branch t]
| CtUpd t
| CtArg (Atom t)
| CtPr... |
71d62100aaa5c0c95c9569001213c3ff0bb5832affdb83c5d6f933bd534bbdcb | kkd26/SiFun | prenex.ml | open Sifun
open Prenex
open DBType
open OUnit2
let prenexInt _ =
(* ARRANGE *)
let input = Mono Int in
let expected = (0, RhoMono Int) in
ACT
let output = pr input in
assert_equal output expected
let prenexBool _ =
(* ARRANGE *)
let input = Mono Bool in
let expected = (0, RhoMono Bool) in
ACT
... | null | https://raw.githubusercontent.com/kkd26/SiFun/787f5842cb9f12d5f4686409be3ee27a8b8a1d22/test/prenex.ml | ocaml | ARRANGE
ARRANGE
ARRANGE
ARRANGE
ARRANGE
ARRANGE
ARRANGE
ARRANGE
ARRANGE
ARRANGE
ARRANGE
ARRANGE
ARRANGE
ARRANGE
ARRANGE | open Sifun
open Prenex
open DBType
open OUnit2
let prenexInt _ =
let input = Mono Int in
let expected = (0, RhoMono Int) in
ACT
let output = pr input in
assert_equal output expected
let prenexBool _ =
let input = Mono Bool in
let expected = (0, RhoMono Bool) in
ACT
let output = pr input in
a... |
035f49376f6c08417a75e4f8511fb221a97cfd2b4b4d93f8f7ea199b8b24a151 | commonqt/commonqt | connect.lisp | ;;; -*- show-trailing-whitespace: t; indent-tabs-mode: nil -*-
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 ret... | null | https://raw.githubusercontent.com/commonqt/commonqt/dffff3ee3dbd0686c85c323f579b8bbf4881e60e/connect.lisp | lisp | -*- show-trailing-whitespace: t; indent-tabs-mode: nil -*-
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 ... |
Copyright ( c ) 2009 . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package :qt)
(named-readtables:in-readtable :qt)
(defun QSIGNAL (str)
(concatenate 'string "2" str))
(defun QSLOT (str)
... |
eafbf9c95125187cc19efa92b5d9628dc1b23e033b7c7609de3f824754a5fc18 | janestreet/bonsai | focus_ring.ml | open! Core
type 'a t =
{ current_focus : 'a
; before_rev : 'a list
; after : 'a list
}
[@@deriving fields, compare, equal, sexp]
let of_nonempty_list_exn full_list =
{ current_focus = List.hd_exn full_list
; before_rev = []
; after = List.tl_exn full_list
}
;;
let next t =
mat... | null | https://raw.githubusercontent.com/janestreet/bonsai/c202b961f41e20e0b735c4e33c2bbac57a590941/web_ui/multi_select/focus_ring/src/focus_ring.ml | ocaml | open! Core
type 'a t =
{ current_focus : 'a
; before_rev : 'a list
; after : 'a list
}
[@@deriving fields, compare, equal, sexp]
let of_nonempty_list_exn full_list =
{ current_focus = List.hd_exn full_list
; before_rev = []
; after = List.tl_exn full_list
}
;;
let next t =
mat... | |
d68eae42cb540a81ec20e4521aa6e9e393a51c9f3ffd89562efc148ffe7babce | NorfairKing/validity | CanFail.hs | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
module Test.Syd.Validity.Functions.CanFail
( succeedsOnGen,
succeeds,
succeedsOnArbitrary,
succeedsOnGens2,
succeeds2,
succeedsOnArbitrary2,
failsOnGen,
failsOnGens2,
validIfSucceedsOnGen,
validIfSucceedsOnArbitra... | null | https://raw.githubusercontent.com/NorfairKing/validity/35bc8d45b27e6c21429e4b681b16e46ccd541b3b/genvalidity-sydtest/src/Test/Syd/Validity/Functions/CanFail.hs | haskell | | The function succeeds if the input is generated by the given generator
| The function succeeds if the input is generated by @arbitrary@
| The function fails if the input is generated by the given generator
| The function produces output that satisfies @isValid@ if it is given input
that is generated by the given... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
module Test.Syd.Validity.Functions.CanFail
( succeedsOnGen,
succeeds,
succeedsOnArbitrary,
succeedsOnGens2,
succeeds2,
succeedsOnArbitrary2,
failsOnGen,
failsOnGens2,
validIfSucceedsOnGen,
validIfSucceedsOnArbitra... |
d3d62809531d9257899e9040f816f24233ed1517ac94dc9fcd87aa5655dd96a5 | TheRealReal/hackney_telemetry | hackney_telemetry_worker_SUITE.erl | -module(hackney_telemetry_worker_SUITE).
-compile(export_all).
-include_lib("common_test/include/ct.hrl").
all() -> [scheduled_reports, state_updates].
%% Setup/Teardown functions
init_per_suite(Config) ->
application:ensure_all_started(telemetry),
Config.
end_per_suite(Config) ->
application:stop(telemetr... | null | https://raw.githubusercontent.com/TheRealReal/hackney_telemetry/d4a00f83d6951ffd488504a4a98849182264ce0e/test/hackney_telemetry_worker_SUITE.erl | erlang | Setup/Teardown functions
Tests
Helpers
This function is attached to telemetry and will send a message to the process
running the test so we can assert over update events. | -module(hackney_telemetry_worker_SUITE).
-compile(export_all).
-include_lib("common_test/include/ct.hrl").
all() -> [scheduled_reports, state_updates].
init_per_suite(Config) ->
application:ensure_all_started(telemetry),
Config.
end_per_suite(Config) ->
application:stop(telemetry),
Config.
init_per_tes... |
f191a948539a8f09ef3829813751339d27532f9880fc172ef066da38570a7896 | scymtym/sbcl-ir-visualizer | inspect.lisp | inspect.lisp --- extensions for SBCL IR objects .
;;;;
Copyright ( C ) 2020 , 2021 Jan Moringen
;;;;
Author : < >
(cl:in-package #:sbcl-ir-visualizer)
Utilities
(defun inspect-part (container part stream)
(clouseau:formatting-place
(container 'clouseau:pseudo-place part nil present-object)
(p... | null | https://raw.githubusercontent.com/scymtym/sbcl-ir-visualizer/2a944ffd458bd452bf93bc49a0a9685edd868719/code/inspect.lisp | lisp |
Type utilities
`component'
Do not show instance slots by default.
IR1
IR2
Instance slots
`cblock'
When the block is inspected as the content of a slot, use
defaults. Otherwise pre-expand.
Instance slots
`node'
Result lvar.
Derived type.
Try to present the referenced leaf nicely.
Input value.
Asserted ... | inspect.lisp --- extensions for SBCL IR objects .
Copyright ( C ) 2020 , 2021 Jan Moringen
Author : < >
(cl:in-package #:sbcl-ir-visualizer)
Utilities
(defun inspect-part (container part stream)
(clouseau:formatting-place
(container 'clouseau:pseudo-place part nil present-object)
(present-obj... |
4771bac4e61e6b2eed839a7d85ecf455e0b711583e722497cb988b02f3b06f70 | haskell-mafia/mismi | Amazonka.hs | # LANGUAGE NoImplicitPrelude #
module Mismi.CloudwatchLogs.Amazonka (
module AWS
) where
import Network.AWS.CloudWatchLogs as AWS
| null | https://raw.githubusercontent.com/haskell-mafia/mismi/f6df07a52c6c8b1cf195b58d20ef109e390be014/mismi-cloudwatch-logs/src/Mismi/CloudwatchLogs/Amazonka.hs | haskell | # LANGUAGE NoImplicitPrelude #
module Mismi.CloudwatchLogs.Amazonka (
module AWS
) where
import Network.AWS.CloudWatchLogs as AWS
| |
3952aefb633f9e1be09df6f647e1ca6cc2a0f4c1a46e7eabd9317daa599473a2 | vikram/lisplibraries | formview.lisp |
(in-package :weblocks)
(export '(*form-default-error-summary-threshold*
*required-field-message* form form-view
form-view-error-summary-threshold form-view-use-ajax-p
form-view-default-method form-view-default-enctype
form-view-default-action form-view-persist-p form-view-focus-p form-view-satisfies
fo... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/weblocks-stable/src/views/formview/formview.lisp | lisp | Default initialization parameters
Form view
Form view fields
Presentation
Form rendering protocol
Implement rendering protocol
Intermediate values helper |
(in-package :weblocks)
(export '(*form-default-error-summary-threshold*
*required-field-message* form form-view
form-view-error-summary-threshold form-view-use-ajax-p
form-view-default-method form-view-default-enctype
form-view-default-action form-view-persist-p form-view-focus-p form-view-satisfies
fo... |
38546095c077e358aacb9d0c6a1f911d2185ffd54e85a8a8f9818cf67ac2f71e | clojure-interop/java-jdk | Text.clj | (ns javax.xml.soap.Text
"A representation of a node whose value is text. A Text object
may represent text that is content or text that is a comment."
(:refer-clojure :only [require comment defn ->])
(:import [javax.xml.soap Text]))
(defn comment?
"Retrieves whether this Text object represents a comment.
... | null | https://raw.githubusercontent.com/clojure-interop/java-jdk/8d7a223e0f9a0965eb0332fad595cf7649d9d96e/javax.xml/src/javax/xml/soap/Text.clj | clojure | false otherwise - `boolean`" | (ns javax.xml.soap.Text
"A representation of a node whose value is text. A Text object
may represent text that is content or text that is a comment."
(:refer-clojure :only [require comment defn ->])
(:import [javax.xml.soap Text]))
(defn comment?
"Retrieves whether this Text object represents a comment.
... |
771530f9736ead97adc5ea57d86d81f7ac9c0a59c290da5683432531f6c6e95b | cardmagic/lucash | re.scm | ;;; The regexp data type
, January 1997 , May 1998 .
A DSM around a choice gets absorbed into the choice 's first elt .
;;; But this prevents it from being moved out into a containing
;;; choice or seq elt, or outer DSM. Fix.
A regexp is a : dsm , submatch , seq , choice , repeat ,
... | null | https://raw.githubusercontent.com/cardmagic/lucash/0452d410430d12140c14948f7f583624f819cdad/reference/scsh-0.6.6/scsh/rx/re.scm | scheme | The regexp data type
But this prevents it from being moved out into a containing
choice or seq elt, or outer DSM. Fix.
Deleted sub-match regexp
submatches, then POST-DSM as dead submatches.
for static regexps.
"Virtual field" for the RE-DSM record -- how many dead submatches
come after the bod... | , January 1997 , May 1998 .
A DSM around a choice gets absorbed into the choice 's first elt .
A regexp is a : dsm , submatch , seq , choice , repeat ,
char - set , string , , eos
This stands for a regexp containing TSM submatches , of which
PRE - DSM come first as dead submat... |
e312e22224a3541a929e09100a13ab4dbbaffa2dd5a44d460a1e284f2b45053c | logseq/logseq | theme.cljs | (ns frontend.components.theme
(:require [frontend.extensions.pdf.core :as pdf]
[frontend.config :as config]
[frontend.handler.plugin :as plugin-handler]
[frontend.handler.plugin-config :as plugin-config-handler]
[frontend.handler.route :as route-handler]
[fr... | null | https://raw.githubusercontent.com/logseq/logseq/2cace8894c5ee725cefd9796f39b900910f55757/src/main/frontend/components/theme.cljs | clojure | for tailwind dark mode
demo graph only
not in publishing mode
other graphs exists
The white-theme is for backward compatibility. See: . | (ns frontend.components.theme
(:require [frontend.extensions.pdf.core :as pdf]
[frontend.config :as config]
[frontend.handler.plugin :as plugin-handler]
[frontend.handler.plugin-config :as plugin-config-handler]
[frontend.handler.route :as route-handler]
[fr... |
dd9b59d4176eb24d1616529a1df6f326c5725379dfab32a45716b87876094865 | ashinn/alschemist | ical.scm |
(define-record-type VCalendar
(make-vcalendar id version calscale method timezones events meta)
vcalendar?
(id vcalendar-id)
(version vcalendar-version)
(calscale vcalendar-calscale)
(method vcalendar-method)
(timezones vcalendar-timezones)
(events vcalendar-events)
(meta vcalendar-meta))
( define... | null | https://raw.githubusercontent.com/ashinn/alschemist/c9ded277d030c4fb26ac2acf2f4dd85123628b58/chibi/ical.scm | scheme | vrecurrence?
(frequency vrecurrence-frequency vrecurrence-frequency-set!)
(interval vrecurrence-interval vrecurrence-interval-set!)
(count vrecurrence-count vrecurrence-count-set!)
(start vrecurrence-start vrecurrence-start-set!)
(end vrecurrence-end vrecurrence-end-set!)
TODO: customize this |
(define-record-type VCalendar
(make-vcalendar id version calscale method timezones events meta)
vcalendar?
(id vcalendar-id)
(version vcalendar-version)
(calscale vcalendar-calscale)
(method vcalendar-method)
(timezones vcalendar-timezones)
(events vcalendar-events)
(meta vcalendar-meta))
( define... |
c36bf1427ad53114533dcc1a2dbb158776d224f1364d0380982457489e0f37db | danidiaz/lens-aeson-examples | doctests.hs | module Main where
import Test.DocTest
main :: IO ()
main = doctest [ "src/Data/Aeson/Lens/Examples.hs" ]
| null | https://raw.githubusercontent.com/danidiaz/lens-aeson-examples/cc9b53db7a18f9fd0781a42c3d173a6d633faba7/tests/doctests.hs | haskell | module Main where
import Test.DocTest
main :: IO ()
main = doctest [ "src/Data/Aeson/Lens/Examples.hs" ]
| |
2d74c1819b4adcaceb463b1ca3c5a55fa842194e484615ec59418e075f027d50 | matthiasn/inspect | core.cljs | (ns inspect.view.core
(:require [inspect.specs.specs]
[inspect.view.log]
[matthiasn.systems-toolbox-electron.ipc-renderer :as ipc]
[inspect.view.store :as st]
[inspect.view.ui :as ui]
[matthiasn.systems-toolbox.switchboard :as sb]
[matthiasn.syst... | null | https://raw.githubusercontent.com/matthiasn/inspect/963ae5e29fc1c836c620cfed67787f1b99c3fe0c/src/cljs/inspect/view/core.cljs | clojure | (ns inspect.view.core
(:require [inspect.specs.specs]
[inspect.view.log]
[matthiasn.systems-toolbox-electron.ipc-renderer :as ipc]
[inspect.view.store :as st]
[inspect.view.ui :as ui]
[matthiasn.systems-toolbox.switchboard :as sb]
[matthiasn.syst... | |
f01ab42158919856e837b13ee9236b046a24df071a9e86647f5a7f63100fb816 | sshastry/queenslogic | QueensLogic.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MonadComprehensions #
{-# LANGUAGE Rank2Types #-}
module QueensLogic where
import Control.Monad.Logic
import Data.List (intersect)
instance Show a => Show (Logic a) where
show l = "Logic> " ++ (show $ observeAll l)
choices :: MonadLogic m => [a] -> m a
choices = msum . ... | null | https://raw.githubusercontent.com/sshastry/queenslogic/40a66336dff50148ac7e3da81b75c06a6b2ae562/src/QueensLogic.hs | haskell | # LANGUAGE Rank2Types #
K for Kleisli
a configuration of nonattacking queens on the board
iswrt := "is safe with respect to"
iswrt :: (Int,Int) -> [Int] -> Bool
we use a monad comprehension | # LANGUAGE FlexibleInstances #
# LANGUAGE MonadComprehensions #
module QueensLogic where
import Control.Monad.Logic
import Data.List (intersect)
instance Show a => Show (Logic a) where
show l = "Logic> " ++ (show $ observeAll l)
choices :: MonadLogic m => [a] -> m a
choices = msum . map return
type K m a = Mon... |
36805192fc48fc0d438adb011c27b0cfe2e08c3061d39a529532f049b18cc5b6 | skanev/playground | 86-tests.scm | (require rackunit rackunit/text-ui)
(load "../86.scm")
(define sicp-2.86-tests
(test-suite
"Tests for SICP exercise 2.86"
(test-suite "type tower"
(check-true (supertype? 'integer 'rational))
(check-true (supertype? 'integer 'real))
(check-true (supertype? 'integer 'complex))
(check-... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/02/tests/86-tests.scm | scheme | (require rackunit rackunit/text-ui)
(load "../86.scm")
(define sicp-2.86-tests
(test-suite
"Tests for SICP exercise 2.86"
(test-suite "type tower"
(check-true (supertype? 'integer 'rational))
(check-true (supertype? 'integer 'real))
(check-true (supertype? 'integer 'complex))
(check-... | |
474661cfa412d00e1e58e6d490d5b30c842b07bc66d7b6ba2a2ce2218cfa15c2 | heyoka/faxe | http_listen_handler.erl | %%%-------------------------------------------------------------------
%%% @author $author
( C ) $ year , $ company
%%% @doc
%%%
%%% @end
%%% Created : $fulldate
%%%-------------------------------------------------------------------
-module(http_listen_handler).
-include("faxe.hrl").
%%
%% Cowboy callbacks
-export(... | null | https://raw.githubusercontent.com/heyoka/faxe/aa0414cd7d80e492c21fd3f57dd06d5a9ebb9e8d/apps/faxe/src/lib/http_listen_handler.erl | erlang | -------------------------------------------------------------------
@author $author
@doc
@end
Created : $fulldate
-------------------------------------------------------------------
Cowboy callbacks
Additional callbacks | ( C ) $ year , $ company
-module(http_listen_handler).
-include("faxe.hrl").
-export([
init/2,
allowed_methods/2,
is_authorized/2,
content_types_accepted/2,
malformed_request/2,
from_req/2, allow_missing_post/2]).
-export([
]).
-record(state, {client_pid, content_type, body, peer, user, pass, bo... |
558c9e5b4d487705258ee12f207cb5eeb5845594375d3db3743c9d12129fe41f | tezos/tezos-mirror | test_carbonated_map.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/39e976ad6eae6446af8ca17ef4a63475ab9fe2b9/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_carbonated_map.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN A... |
f2781b471c55e64a0450b25dce23fba8f0e9610ee6a522477b81224a0738d3fe | huangz1990/SICP-answers | p201-constraint-interface.scm | ;;; p201-constraint-interface.scm
(define (inform-about-value constraint)
(constraint 'I-have-a-value))
(define (inform-about-no-value constraint)
(constraint 'I-lost-my-value))
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp3/code/p201-constraint-interface.scm | scheme | p201-constraint-interface.scm |
(define (inform-about-value constraint)
(constraint 'I-have-a-value))
(define (inform-about-no-value constraint)
(constraint 'I-lost-my-value))
|
ceceac436edd89d547af7a138bfe12f90903efb8aaa213a2725e2cb7747ef01f | NorfairKing/bevel | Username.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
{-# LANGUAGE OverloadedStrings #-}
module Bevel.API.Server.Data.Username where
import Autodocodec
import Control.Arrow (left)
import Data.Aeson
import Data.Text (Text)
import qualified Data.Text as T
import Data.Validity
import Data.Validity.Text ()
import Database.... | null | https://raw.githubusercontent.com/NorfairKing/bevel/8cc74d83d058f916acf4cf247341852600d9456e/bevel-api-server-data/src/Bevel/API/Server/Data/Username.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
module Bevel.API.Server.Data.Username where
import Autodocodec
import Control.Arrow (left)
import Data.Aeson
import Data.Text (Text)
import qualified Data.Text as T
import Data.Validity
import Data.Validity.Text ()
import Database.Persist
import Database.Persist.Sql... |
e10609285dbf86a3c146389c51e68cbb0fc3ee90081f6227ee2ab8fb88181c94 | RichiH/git-repair | Ref.hs | git ref stuff
-
- Copyright 2011 - 2013 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2011-2013 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Git.Ref where
import Common
import Git
import Git.Command
import Git.Sha
import Git.Types
import... | null | https://raw.githubusercontent.com/RichiH/git-repair/c61b677e7a67a286df34c0629c52aeae9be9299a/Git/Ref.hs | haskell | Converts a fully qualified git ref into a user-visible string.
Often git refs are fully qualified (eg: refs/heads/master).
- Converts such a fully qualified ref into a base ref (eg: master).
Given a directory and any ref, takes the basename of the ref and puts
- it under the directory.
Given a directory such a... | git ref stuff
-
- Copyright 2011 - 2013 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2011-2013 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Git.Ref where
import Common
import Git
import Git.Command
import Git.Sha
import Git.Types
import... |
af6767f6c45f8d37aeafcf3c6d6bd53c277f1437b6b8d984d8e595358e64aa51 | lazamar/elm-architecture-haskell | Main.hs | module Main where
import qualified WebCrawler
main :: IO ()
main = WebCrawler.main
| null | https://raw.githubusercontent.com/lazamar/elm-architecture-haskell/009d4d39b7f5a24ed973658b066a27d0839eca4a/app/Main.hs | haskell | module Main where
import qualified WebCrawler
main :: IO ()
main = WebCrawler.main
| |
4b4cd4a58e7f90678468dfce02bfe71e9891717f47cac151e5c77ae1f68a8106 | ProjectMAC/propagators | barometer-test.scm | ;;; ----------------------------------------------------------------------
Copyright 2009 - 2010 .
;;; ----------------------------------------------------------------------
This file is part of Propagator Network Prototype .
;;;
Propagator Network Prototype is free software ; you can
;;; redistribute it and/o... | null | https://raw.githubusercontent.com/ProjectMAC/propagators/add671f009e62441e77735a88980b6b21fad7a79/core/test/barometer-test.scm | scheme | ----------------------------------------------------------------------
----------------------------------------------------------------------
you can
redistribute it and/or modify it under the terms of the GNU
any later version.
will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of M... | Copyright 2009 - 2010 .
This file is part of Propagator Network Prototype .
General Public License as published by the Free Software
Foundation , either version 3 of the License , or ( at your option )
Propagator Network Prototype is distributed in the hope that it
You should have received a copy of the G... |
629fb5c597e4f333b7c9b30059dcfc248b0d0ecfa63c0fe8a673385841974b87 | kayceesrk/Quelea | TH.hs | # Language TemplateHaskell , EmptyDataDecls , ScopedTypeVariables #
module Quelea.TH (
mkOperations,
checkOp,
checkTxn
) where
import Quelea.Types
import Quelea.Contract.Language
import Quelea.Contract.TypeCheck
import Language.Haskell.TH
import Quelea.Marshall
import Quelea.Shim
import Language.Haskell.TH.Syn... | null | https://raw.githubusercontent.com/kayceesrk/Quelea/73db79a5d5513b9aeeb475867a67bacb6a5313d0/src/Quelea/TH.hs | haskell | # Language TemplateHaskell , EmptyDataDecls , ScopedTypeVariables #
module Quelea.TH (
mkOperations,
checkOp,
checkTxn
) where
import Quelea.Types
import Quelea.Contract.Language
import Quelea.Contract.TypeCheck
import Language.Haskell.TH
import Quelea.Marshall
import Quelea.Shim
import Language.Haskell.TH.Syn... | |
0d97e81676b6e2ef013a6ae8caf8ea97730f9de2fbd1ab978248ddaf34c90bc5 | disco-lang/disco | Desugared.hs | # LANGUAGE PatternSynonyms #
-----------------------------------------------------------------------------
-- |
-- Module : Disco.AST.Desugared
-- Copyright : disco team and contributors
-- Maintainer :
--
SPDX - License - Identifier : BSD-3 - Clause
--
-- Typed abstract syntax trees representing the typ... | null | https://raw.githubusercontent.com/disco-lang/disco/4a0d898c703040c24754b97585a0573bac7dc847/src/Disco/AST/Desugared.hs | haskell | ---------------------------------------------------------------------------
|
Module : Disco.AST.Desugared
Copyright : disco team and contributors
Maintainer :
Typed abstract syntax trees representing the typechecked, desugared
Disco language.
-------------------------------------------------------... | # LANGUAGE PatternSynonyms #
SPDX - License - Identifier : BSD-3 - Clause
module Disco.AST.Desugared
DTerm
, pattern DTVar
, pattern DTPrim
, pattern DTUnit
, pattern DTBool
, pattern DTChar
, pattern DTNat
, pattern DTRat
, pattern DTAbs
, patte... |
04d0a1ee5ffbff2e8bd0b33a659ae29d76aaf3091d24ade07b3e2df23b0a54d1 | evanrelf/sudoku-tui | Main.hs | module Main (main) where
import UI (main)
| null | https://raw.githubusercontent.com/evanrelf/sudoku-tui/5b7544296cc275e6f0a7b5781667962512ddf943/src/Main.hs | haskell | module Main (main) where
import UI (main)
| |
32fd082c74fdccdbd0431b76da2de65b3138f362037e020bee0609f859c224b6 | theodormoroianu/SecondYearCourses | lab2.hs | la nevoie decomentati liniile urmatoare :
import Data .
import Data . List
-- pentru teste
--import Test.QuickCheck
---------------------------------------------
-------RECURSIE: FIBONACCI-------------------
---------------------------------------------
fibonacciCazuri :: Integer -> Integer
fibonacciCazuri n... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/99185b0e97119135e7301c2c7be0f07ae7258006/Haskell/l/lab2/lab2.hs | haskell | pentru teste
import Test.QuickCheck
-------------------------------------------
-----RECURSIE: FIBONACCI-------------------
-------------------------------------------
testFibo :: Integer -> Property
-------------------------------------------
------RECURSIE PE LISTE -----------------
--------------------------------... | la nevoie decomentati liniile urmatoare :
import Data .
import Data . List
fibonacciCazuri :: Integer -> Integer
fibonacciCazuri n
| n < 2 = n
| otherwise = fibonacciCazuri (n - 1) + fibonacciCazuri (n - 2)
fibonacciEcuational :: Integer -> Integer
fibonacciEcuational 0 = 0
fibonacciEcuational 1 = 1... |
97adf1f7817127c3fbb38a8c2329ec88a21628ed3cbf34f39d86066146b93964 | khotyn/4clojure-answer | 62-reimplement-iterate.clj | (fn [f x]
(letfn [(step [f x]
(lazy-seq
(cons
x
(step f (f x)))))]
(step f x)))
| null | https://raw.githubusercontent.com/khotyn/4clojure-answer/3de82d732faedceafac4f1585a72d0712fe5d3c6/62-reimplement-iterate.clj | clojure | (fn [f x]
(letfn [(step [f x]
(lazy-seq
(cons
x
(step f (f x)))))]
(step f x)))
| |
22b514567a3039516321f853804c5260abd34392e85788bd6f23c0f4a547abf4 | clojerl/clojerl | clojerl_List_SUITE.erl | -module(clojerl_List_SUITE).
-include("clojerl.hrl").
-include("clj_test_utils.hrl").
-export([ all/0
, init_per_suite/1
, end_per_suite/1
]).
-export([ new/1
, count/1
, str/1
, is_sequential/1
, hash/1
, seq/1
, equiv/1
, cons/1
... | null | https://raw.githubusercontent.com/clojerl/clojerl/aa35847ca64e1c66224867ca4c31ca6de95bc898/test/clojerl_List_SUITE.erl | erlang | ------------------------------------------------------------------------------
Test Cases
------------------------------------------------------------------------------ | -module(clojerl_List_SUITE).
-include("clojerl.hrl").
-include("clj_test_utils.hrl").
-export([ all/0
, init_per_suite/1
, end_per_suite/1
]).
-export([ new/1
, count/1
, str/1
, is_sequential/1
, hash/1
, seq/1
, equiv/1
, cons/1
... |
49adc7348d94894e3f6a9e71843eccc57154d2234d269a465e8f813c2b5b2363 | input-output-hk/cardano-wallet | Shelley.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE NumericUnderscores #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
-- |
Copyright : © 2020
-- License: Apache-2.0
--
This module provides the main walle... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/b14711d3a1256f87a7edc01dc365f8801593fe21/lib/wallet/api/http/Cardano/Wallet/Shelley.hs | haskell | |
License: Apache-2.0
TxSubmission) to talk with a core node and synchronize with the network.
Functionality specific to this backend for creating transactions is in
| The @cardano-wallet@ main function. It takes the configuration
which was passed from the CLI and environment and starts all components of
the ... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE NumericUnderscores #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
Copyright : © 2020
This module provides the main wallet server function for .
The ... |
2af8fc2f0aa7c4f8488545a5b1e1ea823aeed651f9737800b3a1a7980ff3e501 | jwiegley/notes | Alt.hs | module Alt where
import Control.Applicative
main :: IO ()
main =
let f x = if x == 1 then Just 4 else Nothing
g x = if x == 3 then Just 7 else Nothing
in print $ liftA2 (<|>) f g 5
| null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/gists/f719a3d41696d48f6005/gists/b042e3b252e93deaa960/Alt.hs | haskell | module Alt where
import Control.Applicative
main :: IO ()
main =
let f x = if x == 1 then Just 4 else Nothing
g x = if x == 3 then Just 7 else Nothing
in print $ liftA2 (<|>) f g 5
| |
93ff0f4846610d387cb010557bc3f423712c0a26d8cff1427e94d8b1a879f312 | input-output-hk/ouroboros-network | Abstract.hs | # LANGUAGE DefaultSignatures #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE TypeFamilies #-}
module Ouroboros.Consensus.Protocol.Abstract (
* Abstract definition of the Ouroboros protocol
ConsensusConfig
, ConsensusProtocol (..)
, preferCandidate
-- * Convenience re-exports
, SecurityParam (..)
... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/1f6433d0d2e17511a17df7ee9b76be9df74887d2/ouroboros-consensus/src/Ouroboros/Consensus/Protocol/Abstract.hs | haskell | # LANGUAGE TypeFamilies #
* Convenience re-exports
| Static configuration required to run the consensus protocol
configuration as a parameter, so having this as a data family rather than a
type family resolves most ambiguity.
Defined out of the class so that protocols can define this type without
having to... | # LANGUAGE DefaultSignatures #
# LANGUAGE FlexibleContexts #
module Ouroboros.Consensus.Protocol.Abstract (
* Abstract definition of the Ouroboros protocol
ConsensusConfig
, ConsensusProtocol (..)
, preferCandidate
, SecurityParam (..)
) where
import Control.Monad.Except
import Dat... |
62b49609c57bd7c47ba1cd6d4c32c3a799931ab0cd9c32736afaa49e65ed1e7e | diagrams/diagrams-core | Measure.hs | {-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFunctor #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - unused - imports #
for Data . Semigroup import , which becomes redundant under GHC 8.4
module Diagrams.Core.Measure
(... | null | https://raw.githubusercontent.com/diagrams/diagrams-core/029eaf272fa0fdf111d04af80a348a0ce2e90df7/src/Diagrams/Core/Measure.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE DeriveFunctor #
| 'Measured n a' is an object that depends on 'local', 'normalized'
and 'global' scales. The 'normalized' and 'global' scales are
calculated when rendering a diagram.
For attributes, the 'local' scale gets multiplied by the avera... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - unused - imports #
for Data . Semigroup import , which becomes redundant under GHC 8.4
module Diagrams.Core.Measure
( Measured (..)
, Measure
, fromMeasured
, output
, local
, global
, normaliz... |
ebe0cb1dab0c33b3de3e12cd3c6f147a5abf0315de65aa9e9373c36641e22b37 | achirkin/qua-view | Types.hs | {-# LANGUAGE CPP #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE Strict #-}
#ifndef ISWORKER
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE FlexibleInstances #
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GADTs #-}
# OPT... | null | https://raw.githubusercontent.com/achirkin/qua-view/62626ead828889a1c7ef1fdba4d84324eb5420b3/src/Workers/Types.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE Strict #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
# LANGUAGE GADTs #
| LoadGeometryWorker messages
^ Send parsed Scenario
^ Worker is ready!
^ Something went wrong!
| Send a reques... | # LANGUAGE DeriveGeneric #
#ifndef ISWORKER
# LANGUAGE FlexibleInstances #
# OPTIONS_GHC -fno - warn - orphans #
#endif
module Workers.Types
( LGWMessage (..), LGWRequest (..)
, lgwRequestCurrentScenario
#ifndef ISWORKER
, QEventTag (..)
#endif
) where
import GHC.Generics
#ifdef ISWORKER
im... |
afe124a8e73f2ce37375ecfba92cd6da5387a5f1439aadce11f3dda12111c8fb | CorticalComputer/DXNN2 | polis.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This source code and work is provided and developed by . COM
%
The original release of this source code and the DXNN MK2 system was introduced and explained in my book : Handbook of Neuroevolution Through Erlang . Springer 2012 , print I... | null | https://raw.githubusercontent.com/CorticalComputer/DXNN2/d57d43a91f125f3930e06611f5fce15a0462b32f/src/polis.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 g... | This source code and work is provided and developed by . COM
The original release of this source code and the DXNN MK2 system was introduced and explained in my book : Handbook of Neuroevolution Through Erlang . Springer 2012 , print ISBN : 978 - 1 - 4614 - 4462 - 6 ebook ISBN : 978 - 1 - 4614 - 4463 - 6 .
Co... |
d462fa0e7a4e71ca5782f0d61f5c77f04dfb452a9010ba9d9dc2f52fc0671d3e | slyrus/mcclim-old | tree-with-cross-edges.lisp | ;;; -*- Mode: Lisp; Package: CLIM-INTERNALS -*-
;;;---------------------------------------------------------------------------
Copyright ( c ) 2005 - 2007 and Smart Information
Flow Technologies , d / b / a SIFT , LLC
;;;
;;; This library is free software; you can redistribute it and/or
modify it under the te... | null | https://raw.githubusercontent.com/slyrus/mcclim-old/354cdf73c1a4c70e619ccd7d390cb2f416b21c1a/Experimental/tree-with-cross-edges/tree-with-cross-edges.lisp | lisp | -*- Mode: Lisp; Package: CLIM-INTERNALS -*-
---------------------------------------------------------------------------
This library is free software; you can redistribute it and/or
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty ... |
Copyright ( c ) 2005 - 2007 and Smart Information
Flow Technologies , d / b / a SIFT , LLC
modify it under the terms of the GNU Library General Public
version 2 of the License , or ( at your option ) any later version .
Library General Public License for more details .
You should have received a copy of... |
2a46e7067b8bea45c0ac103f6ecdb9e6c7f6acbe582f9224f98861927f12f79c | alanz/ghc-exactprint | TH_raiseErr1.hs | # LANGUAGE TemplateHaskell #
module TH_raiseErr1 where
import Language.Haskell.TH
foo = $(do { report True "Error test succeeded"; fail "" })
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc86/TH_raiseErr1.hs | haskell | # LANGUAGE TemplateHaskell #
module TH_raiseErr1 where
import Language.Haskell.TH
foo = $(do { report True "Error test succeeded"; fail "" })
| |
e8b3360701f2f477180023874f1eb3a1483671acbf0db6d4465154c1b1ffba76 | rd--/hsc3 | sndfileRead.help.hs | -- sndfileRead ; buffer identifier with " brackets " to hold b_allocRead and b_free messages
let (buf, nc, _, _) = sndfileRead ("buf", 0, []) "metal.wav" -- metal.wav is mono ; pf-c5.aif is stereo
tr = impulse ar (bufSampleRate kr buf / bufFrames kr buf) 0
ph = phasor ar tr (bufSampleRate kr buf / sampleRate) 0... | null | https://raw.githubusercontent.com/rd--/hsc3/60cb422f0e2049f00b7e15076b2667b85ad8f638/Help/Ugen/sndfileRead.help.hs | haskell | sndfileRead ; buffer identifier with " brackets " to hold b_allocRead and b_free messages
metal.wav is mono ; pf-c5.aif is stereo
-- sndfileRead ; as above but use constants for sample rate and frame count
metal.wav is mono ; pf-c5.aif is stereo
sndfileRead ; sine wave control of playback rate, negative rate plays ... | tr = impulse ar (bufSampleRate kr buf / bufFrames kr buf) 0
ph = phasor ar tr (bufSampleRate kr buf / sampleRate) 0 (bufFrames kr buf) 0
in bufRdL nc ar buf ph NoLoop
tr = impulse ar (sr / nf) 0
ph = phasor ar tr (sr / sampleRate) 0 nf 0
in bufRdL nc ar buf ph NoLoop
let (buf, nc, _, _) = sndfileRead ... |
57fd0a5277e0c5663007abd7e0cbe1f87c8f56942ac431fae1a061d4dc71c677 | janestreet/hardcaml_verilator | hardcaml_verilator.ml | open Core
open Hardcaml
open Ctypes
open Ctypes_foreign_flat
open Foreign
module Unix = Core_unix
module Cache = struct
type t =
| No_cache
| Hashed of { cache_dir : string }
| Explicit of { file_name : string }
[@@deriving sexp, bin_io]
end
module Simulation_backend = struct
type t =
| Hardcaml... | null | https://raw.githubusercontent.com/janestreet/hardcaml_verilator/42a3a4e08d85a3c85a4421248122e1294f5bb3d4/src/hardcaml_verilator.ml | ocaml | This is obtained based on an empirical observation of verilator generated outputs.
only use named internal signals
Memories are exposed as 2d arrays so adjust the size to make sure we round
up and correctly read the entire contents.
dlopen requires an explicit path name to an existing file.
anno... | open Core
open Hardcaml
open Ctypes
open Ctypes_foreign_flat
open Foreign
module Unix = Core_unix
module Cache = struct
type t =
| No_cache
| Hashed of { cache_dir : string }
| Explicit of { file_name : string }
[@@deriving sexp, bin_io]
end
module Simulation_backend = struct
type t =
| Hardcaml... |
0ef5f4dd7940c4528a48a7f28b62c87d0889fda6870b1e1c9ddf36404ce5e57d | rizo/snowflake-os | reload.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/plugins/ocamlopt.opt/asmcomp/reload.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ Id$
val fundecl: Mach.fundecl -> ... |
d06d30f7310dedcd3c9bf508b4de4566c07c584971f88e5db803818b11791eae | zhugecaomao/AutoLISP | chen1-乘法计算.lsp | ;³Ë·¨¼ÆËã
(DEFUN C:chen1()
(setq jd (getint "input ¾«¶È<0>:"))
(if (= jd nil) (setq jd 0))
(princ "\nselect object:")
(setq s (ssget))
(setq n (sslength s))
(setq k 0 )(setq mm 0.0)
(while (< k n)
(setq name (ssname s k))
(setq a (entget name))
(setq t1 (assoc '0 a))
(setq t1 (cdr t1))
... | null | https://raw.githubusercontent.com/zhugecaomao/AutoLISP/3e97f911068124f3ea8a1cf6f1d8be9f8227c64b/chen1-%E4%B9%98%E6%B3%95%E8%AE%A1%E7%AE%97.lsp | lisp | ³Ë·¨¼ÆËã | (DEFUN C:chen1()
(setq jd (getint "input ¾«¶È<0>:"))
(if (= jd nil) (setq jd 0))
(princ "\nselect object:")
(setq s (ssget))
(setq n (sslength s))
(setq k 0 )(setq mm 0.0)
(while (< k n)
(setq name (ssname s k))
(setq a (entget name))
(setq t1 (assoc '0 a))
(setq t1 (cdr t1))
(if (... |
f5320eb8434e3fb541f566258923ae8081eba23407ade7b3fc14966cdd339d6d | grin-compiler/grin | AST.hs | # LANGUAGE TupleSections , LambdaCase , OverloadedStrings #
module Grin.Parse.AST
( parseGrin
, parseProg
, parseDef
, parseExpr
) where
import Data.Char
import Data.Void
import Data.Text (Text)
import qualified Data.Text as T
import Control.Applicative (empty)
import Control.Monad (void, mzero)
import Tex... | null | https://raw.githubusercontent.com/grin-compiler/grin/572fc24b2a89ad15c058b363aa26c6913b1b1765/grin/src/Grin/Parse/AST.hs | haskell | grin syntax
FIXME: remove '$' from app syntax, fix 'value' and 'simpleValue' parsers with using 'lineFold' instead
#undefined can hold simple types as well as node types
externals
top-level API | # LANGUAGE TupleSections , LambdaCase , OverloadedStrings #
module Grin.Parse.AST
( parseGrin
, parseProg
, parseDef
, parseExpr
) where
import Data.Char
import Data.Void
import Data.Text (Text)
import qualified Data.Text as T
import Control.Applicative (empty)
import Control.Monad (void, mzero)
import Tex... |
f453cca285ef56b11a996c91635493da1a74403d2fb6e1d03686c2e933c582b4 | cryptosense/records | record.ml | open Result
module Json_safe = struct
let (>>=) x f =
match x with
| Error _ as e -> e
| Ok y -> f y
let (>>|) x f =
x >>= fun y -> Ok (f y)
let rec mapM_ f = function
| [] -> Ok ()
| x::xs ->
f x >>= fun () ->
mapM_ f xs
let rec assoc_option key = function
| [] -> No... | null | https://raw.githubusercontent.com/cryptosense/records/c277573c4d5855f3c185743b8b4871896a89cc7b/src/record.ml | ocaml | The [dummy] is a place holder for t fields. We use it
instead of boxing each value in an option. If the user accesses a
field that contains this dummy value, we raise an exception (the
field was not initialized.). This avoid an extra layer of boxing
w.r.t. to the solution in which each field is an option. ... | open Result
module Json_safe = struct
let (>>=) x f =
match x with
| Error _ as e -> e
| Ok y -> f y
let (>>|) x f =
x >>= fun y -> Ok (f y)
let rec mapM_ f = function
| [] -> Ok ()
| x::xs ->
f x >>= fun () ->
mapM_ f xs
let rec assoc_option key = function
| [] -> No... |
d60e2f090787012a1b4a609523d09468629c898c6b68127906ae72ac43c985f9 | originrose/cortex | dimensions.clj | (ns cortex.tensor.dimensions
"Cortex tensors dimensions control the shape and stride of the tensor along with offsetting
into the actual data buffer. This allows multiple backends to share a single implementation
of a system that will allow transpose, reshape, etc. assuming the backend correctly interprets
the... | null | https://raw.githubusercontent.com/originrose/cortex/94b1430538e6187f3dfd1697c36ff2c62b475901/src/cortex/tensor/dimensions.clj | clojure | If the dimension is direct and the stride lines up.
Find out where there are is padding added. We cannot combine
indexes across non-packed boundaries.
Due to minimization, this is always an error
Convert all :all arguments to either numbers or vectors
performing argument checking if possible.
Is this something shape-a... | (ns cortex.tensor.dimensions
"Cortex tensors dimensions control the shape and stride of the tensor along with offsetting
into the actual data buffer. This allows multiple backends to share a single implementation
of a system that will allow transpose, reshape, etc. assuming the backend correctly interprets
the... |
0a871ff046b48afa2a7eb3ee880b3e0af7a1d845e5c3ab1430f0e770c0a8fce6 | bldl/magnolisp | test-locals-3.rkt | #lang magnolisp
(define (f x)
#:: (export)
(let ()
(typedef int #:: (foreign))
(cast int x)))
(define (g)
#:: (export)
(let ()
(typedef int #:: (foreign))
(typedef long #:: (foreign))
(cast int 2)))
(define (h)
#:: (export)
(let* ((Num (annotate ([foreign int])
(foreig... | null | https://raw.githubusercontent.com/bldl/magnolisp/191d529486e688e5dda2be677ad8fe3b654e0d4f/tests/test-locals-3.rkt | racket | #lang magnolisp
(define (f x)
#:: (export)
(let ()
(typedef int #:: (foreign))
(cast int x)))
(define (g)
#:: (export)
(let ()
(typedef int #:: (foreign))
(typedef long #:: (foreign))
(cast int 2)))
(define (h)
#:: (export)
(let* ((Num (annotate ([foreign int])
(foreig... | |
82bb2f0834fb62adcfcad4978f493c64acc9813e2bf08a0677f0f85f0abccc2f | tonyday567/mvc-todo | mvc-todo.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad.Trans.State.Strict (State, StateT)
import MVC hiding ((<>))
import MVC.Prelude as MVC
import Protolude hiding (State, StateT, loop)
import Todo.Controllers (controllers)
import Todo.Model
import Todo.Vanilla (onload)
import Todo.Views (render)
... | null | https://raw.githubusercontent.com/tonyday567/mvc-todo/13b2e52f1169c77caf528d3ce74901ad6f06eec6/apps/mvc-todo.hs | haskell | # LANGUAGE OverloadedStrings # |
module Main where
import Control.Monad.Trans.State.Strict (State, StateT)
import MVC hiding ((<>))
import MVC.Prelude as MVC
import Protolude hiding (State, StateT, loop)
import Todo.Controllers (controllers)
import Todo.Model
import Todo.Vanilla (onload)
import Todo.Views (render)
import qualified Data.Map as Map
m... |
59e371e017a396bd24028f334ff9f98e69b868df48d76d410c081be87c2d0fee | pirapira/coq2rust | tacintern.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/tactics/tacintern.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* Globalization of tactic expression... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pattern
open Pp
open Gen... |
d01bb7b71b0d6ed530acc129b8971ed943b0285ff399c6afcac98348b3a33e72 | haskell-rewriting/term-rewriting | Type.hs | -- This file is part of the 'term-rewriting' library. It is licensed
under an MIT license . See the accompanying ' LICENSE ' file for details .
--
Authors :
module Data.Rewriting.Substitution.Type (
Subst,
GSubst,
-- * utilities not reexported from 'Data.Rewriting.Substitution'
fromMap,
toMap... | null | https://raw.githubusercontent.com/haskell-rewriting/term-rewriting/d01ee419f9fd3c2011d37b6417326a9373d5ee9c/src/Data/Rewriting/Substitution/Type.hs | haskell | This file is part of the 'term-rewriting' library. It is licensed
* utilities not reexported from 'Data.Rewriting.Substitution'
| A substitution, mapping variables to terms. Substitutions are
equal to the identity almost everywhere.
| A generalised? substitution: a finite, partial map from variables
to terms wit... | under an MIT license . See the accompanying ' LICENSE ' file for details .
Authors :
module Data.Rewriting.Substitution.Type (
Subst,
GSubst,
fromMap,
toMap,
) where
import Data.Rewriting.Term.Type
import qualified Data.Map as M
type Subst f v = GSubst v f v
newtype GSubst v f v' = GS { unGS ... |
10845b57bc757b0b602c0799c3c5482ea11716ca6631a775e0e1705e8501c47b | boot-clj/boot | tmpdir_test.clj | (ns boot.tmpdir-test
(:refer-clojure :exclude [hash time])
(:require
[clojure.test :refer :all]
[boot.tmpdir :as tmpd]))
(defn has-path? [fs path]
(contains? (:tree fs) path))
(deftest diff*-scalar-test
(let [before (tmpd/map->TmpFileSet {:tree {}})
after (tmpd/map->TmpFileSet {:tree {"path" {... | null | https://raw.githubusercontent.com/boot-clj/boot/64334b4d5744b1444634f4a5a5a52b3ae67dddeb/boot/pod/test/boot/tmpdir_test.clj | clojure | (ns boot.tmpdir-test
(:refer-clojure :exclude [hash time])
(:require
[clojure.test :refer :all]
[boot.tmpdir :as tmpd]))
(defn has-path? [fs path]
(contains? (:tree fs) path))
(deftest diff*-scalar-test
(let [before (tmpd/map->TmpFileSet {:tree {}})
after (tmpd/map->TmpFileSet {:tree {"path" {... | |
c8fc69752a072a41b741abb0ca587ef8f85d7e741c71acfc712546cc88260e95 | na4zagin3/satyrographos | template_docOmake_ja.ml |
SPDX - License - Identifier : CC0 - 1.0
SPDX-License-Identifier: CC0-1.0
*)
let satyristes_template =
"Satyristes",
{|(lang "0.0.3")
(doc
(name "main")
(build ((omake)))
(dependencies
(;; Standard library
dist
;; Third-party library
fss
)))
|}
let readme_template =
"README.md",
... | null | https://raw.githubusercontent.com/na4zagin3/satyrographos/9dbccf05138510c977a67c859bbbb48755470c7f/src/template/template_docOmake_ja.ml | ocaml |
SPDX - License - Identifier : CC0 - 1.0
SPDX-License-Identifier: CC0-1.0
*)
let satyristes_template =
"Satyristes",
{|(lang "0.0.3")
(doc
(name "main")
(build ((omake)))
(dependencies
(;; Standard library
dist
;; Third-party library
fss
)))
|}
let readme_template =
"README.md",
... | |
78660ff57274a5244c7317c4fd8ae78d84b2274259d1293f3f48338ec1946b7f | keigoi/ocaml-mpst | lin.mli | exception InvalidEndpoint
type +'a lin
(** Linear type constructor *)
type 's gen
val declare : 'a -> 'a lin gen
(** Declare a linear resource *)
val fresh : 'a gen -> 'a
(** Generate a fresh linear resource *)
val use : 'a lin -> 'a
(** Extract the value. Raises InvalidEndpoint if the endpoint is already
cons... | null | https://raw.githubusercontent.com/keigoi/ocaml-mpst/aa6c5fa2b08c4596f41f70dee8601da6a9c80b8f/lib/lin_dyn/lin.mli | ocaml | * Linear type constructor
* Declare a linear resource
* Generate a fresh linear resource
* Extract the value. Raises InvalidEndpoint if the endpoint is already
consumed
* Wrap a linear resource
* Wrap a linear resource
* Lift given disjoint concatenation | exception InvalidEndpoint
type +'a lin
type 's gen
val declare : 'a -> 'a lin gen
val fresh : 'a gen -> 'a
val use : 'a lin -> 'a
val map_gen : ('a -> 'b) -> 'a gen -> 'b gen
val map_lin : ('a -> 'b) -> 'a lin -> 'b lin
val raw_lin : 'a lin -> 'a
val raw_gen : 'a gen -> 'a
val merge_gen : ('a -> 'b -> 'c) -> 'a... |
6fe3b4dc89e2738e26277bd73df8bef9faf89934f712f37309d45b45b0f42a37 | dleslie/allegro-egg | font.scm | (define register-font-loader (foreign-lambda bool "al_register_font_loader" (const c-string) (function font ((const c-string) integer integer))))
(define load-bitmap-font* (foreign-lambda font "al_load_bitmap_font" (const c-string)))
(define load-font* (foreign-lambda font "al_load_font" (const c-string) integer font-... | null | https://raw.githubusercontent.com/dleslie/allegro-egg/0435fb891dda5c64e95aa9dedccddd31b17e27da/font.scm | scheme | (define register-font-loader (foreign-lambda bool "al_register_font_loader" (const c-string) (function font ((const c-string) integer integer))))
(define load-bitmap-font* (foreign-lambda font "al_load_bitmap_font" (const c-string)))
(define load-font* (foreign-lambda font "al_load_font" (const c-string) integer font-... | |
ba6f6dc739676e7fdef2bdf60dc00b36885f58456cfeb0fd3528ba600549bd3b | jsthomas/tidy_email | email.ml | type body =
| Text of string
| Html of string
| Mixed of string * string * string option
type t = {
sender : string;
recipients : string list;
subject : string;
body : body;
}
let make ~sender ~recipient ~subject ~body =
{ sender; recipients = [recipient]; subject; body }
| null | https://raw.githubusercontent.com/jsthomas/tidy_email/00c45ee9a818a2e352de0e6d0353bc7ada1075f6/tidy_email/src/email.ml | ocaml | type body =
| Text of string
| Html of string
| Mixed of string * string * string option
type t = {
sender : string;
recipients : string list;
subject : string;
body : body;
}
let make ~sender ~recipient ~subject ~body =
{ sender; recipients = [recipient]; subject; body }
| |
5f3694401c2f9cabb34289f1aee8eafd29f169a7d826186b91251fefbd10d3fb | webyrd/n-grams-for-synthesis | variant-dynamic-ordering-with-application-and-lookup-optimizations-ml.scm | (define *output-table-file-name* "tmp/variant-dynamic-ordering-with-application-and-lookup-optimizations-ml-table.scm")
(define allow-incomplete-search? #f)
(define lookup-optimization? #t)
(load "mk-vicare.scm")
(load "mk.scm")
(load "test-check.scm")
(load "interp-app-optimization-ml.scm")
(load "construct-orderin... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/variant-dynamic-ordering-with-application-and-lookup-optimizations-ml.scm | scheme | (define *output-table-file-name* "tmp/variant-dynamic-ordering-with-application-and-lookup-optimizations-ml-table.scm")
(define allow-incomplete-search? #f)
(define lookup-optimization? #t)
(load "mk-vicare.scm")
(load "mk.scm")
(load "test-check.scm")
(load "interp-app-optimization-ml.scm")
(load "construct-orderin... | |
9e926ad28ce2bfc8fd2ec48d936dfad677f0942bf64c72ee7491a806c88f4d70 | qkrgud55/ocamlmulti | asttypes.mli | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/qkrgud55/ocamlmulti/74fe84df0ce7be5ee03fb4ac0520fb3e9f4b6d1f/parsing/asttypes.mli | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : asttypes.mli 12511 2012 - 05 ... |
0d2ec7455883418a53a8495c6862f2b2d1a0e846d28665f817743948ade6d116 | haskus/packages | Monad.hs | {-# LANGUAGE Rank2Types #-}
# LANGUAGE TypeFamilies #
# LANGUAGE LambdaCase #
-- | Utils for Monads
module Haskus.Utils.Monad
( MonadInIO (..)
, module Control.Monad
, module Control.Monad.IO.Class
, module Control.Monad.Trans.Class
, whileM
, loop
, loopM
, whenM
, unlessM
, ifM
, not... | null | https://raw.githubusercontent.com/haskus/packages/40ea6101cea84e2c1466bc55cdb22bed92f642a2/haskus-utils-data/src/lib/Haskus/Utils/Monad.hs | haskell | # LANGUAGE Rank2Types #
| Utils for Monads
| Keep running an operation until it becomes 'False'. As an example:
@
readFile "foo.txt"
@
If you need some state persisted between each test, use 'loopM'.
Looping
| A looping operation, where the predicate returns 'Left' as a seed for the next loop
or 'Right' ... | # LANGUAGE TypeFamilies #
# LANGUAGE LambdaCase #
module Haskus.Utils.Monad
( MonadInIO (..)
, module Control.Monad
, module Control.Monad.IO.Class
, module Control.Monad.Trans.Class
, whileM
, loop
, loopM
, whenM
, unlessM
, ifM
, notM
, anyM
, allM
, orM
, andM
)
wher... |
b198b0571ca30756faff3f6d0bb8ce410d8f33a729dac461db1902c119dda9ab | Dexterminator/imperimetric | routes.cljs | (ns imperimetric.routes
(:require-macros [secretary.core :refer [defroute]])
(:import goog.History)
(:require [secretary.core :as secretary]
[goog.events :as events]
[goog.history.EventType :as EventType]
[re-frame.core :as re-frame]))
(defn hook-browser-navigation... | null | https://raw.githubusercontent.com/Dexterminator/imperimetric/57e975c470490724f69cc43c2f5d0fa2359745d0/src/cljs/imperimetric/routes.cljs | clojure | (ns imperimetric.routes
(:require-macros [secretary.core :refer [defroute]])
(:import goog.History)
(:require [secretary.core :as secretary]
[goog.events :as events]
[goog.history.EventType :as EventType]
[re-frame.core :as re-frame]))
(defn hook-browser-navigation... | |
520c6aa78c528e0c48a2b3fb86c3303e8c0eb7a782bf9fd85d4443aaf0fc07b2 | lispbuilder/lispbuilder | yacc-tests.lisp | Copyright ( c ) 2005 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 , including without limitation the rights
; to use, copy, modify, merge, publish, distribute, ... | null | https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-yacc/yacc-tests.lisp | lisp | 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
furnished to do so, subject to the following conditions:
The above copyright notice an... | Copyright ( c ) 2005 by
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
... |
fb7c5d9528fd2db201e13b8a1db2a15fa71fd3adb6e81f9b1c1f26117c735cd9 | titola/incudine | cffi-osc.lisp | Copyright ( c ) 2015 - 2016
;;;
;;; 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/network/cffi-osc.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 ) 2015 - 2016
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.osc)
#+linux
Do n't generate .
(def... |
11e7f5993dbbcda4b715a7af8f7fb29b6c28d2abdb466b247ebb82c0f14ff224 | webyrd/n-grams-for-synthesis | srfi-144-constants.scm | ;;;; mathh-constants.scm
;;; Common flonum constants in <math.h> + more
;;; The values are derived from the Chicken mathh.egg, but are not subject to copyright.
;; The precision is greater than those found in <math.h>
;; but in practice not perfectly representable
(define-constant fl-e 2.718281828459... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/datasets/srfi/srfi-144/srfi-144-constants.scm | scheme | mathh-constants.scm
Common flonum constants in <math.h> + more
The values are derived from the Chicken mathh.egg, but are not subject to copyright.
The precision is greater than those found in <math.h>
but in practice not perfectly representable
e
e^2
e^(pi/4)
log_2(e)
log_10(e)
ln(2)
1/ln(2)
ln(3)
ln(pi)... |
1 / e
1 / ln(10 )
pi * 2
2 / sqrt(pi )
1 / ln(phi )
|
f53d86a357f2ed2edda3a30d594fa1512bb81315688bd49a206ac46617cc8861 | bobatkey/CS316-17 | Lec19.hs | module Lec19 where
import Prelude hiding (const, take, iterate)
import Debug.Trace
LECTURE 19 : LAZY EVALUATION AND INFINITE DATA
This lecture is about how evaluates programs , which is
different to how most programming languages work . employs
' lazy evaluation ' , which means that values are... | null | https://raw.githubusercontent.com/bobatkey/CS316-17/36eb67c335cd0e6f5b7a4b8eafdea3cd4b715e0c/lectures/Lec19.hs | haskell | A simple function:
------------------------------------------------------------------
------------------------------------------------------------------
it is strictly
it is strictly
------------------------------------------------------------------
For long lists, the 0+1+2+3+4+5+... builds up and is not evaluat... | module Lec19 where
import Prelude hiding (const, take, iterate)
import Debug.Trace
LECTURE 19 : LAZY EVALUATION AND INFINITE DATA
This lecture is about how evaluates programs , which is
different to how most programming languages work . employs
' lazy evaluation ' , which means that values are... |
d4e8c7697573f8f70a1529f3cf0bff99edeef981ca73716affdf0c2a093c374c | jiesoul/soul-talk | views.cljs | (ns soul-talk.tag.views
(:require [reagent.core :as r]
[re-frame.core :refer [dispatch subscribe]]
[soul-talk.common.views :as c]
[soul-talk.utils :as du]
[soul-talk.routes :refer [navigate!]]
["semantic-ui-react" :refer [Form Button Table Divider Icon Conta... | null | https://raw.githubusercontent.com/jiesoul/soul-talk/630de08c6549b206d59023764d5f2576d97d1030/admin/src/soul_talk/tag/views.cljs | clojure | (ns soul-talk.tag.views
(:require [reagent.core :as r]
[re-frame.core :refer [dispatch subscribe]]
[soul-talk.common.views :as c]
[soul-talk.utils :as du]
[soul-talk.routes :refer [navigate!]]
["semantic-ui-react" :refer [Form Button Table Divider Icon Conta... | |
15801b2a9d099790a76f103fa667220ff10b2caa0565a26223b8f7cc9c24d5e9 | blitzcode/ray-marching-distance-fields | QuadRendering.hs |
# LANGUAGE RecordWildCards
, OverloadedStrings
, LambdaCase
, FlexibleContexts
, BangPatterns
, ScopedTypeVariables #
, OverloadedStrings
, LambdaCase
, FlexibleContexts
, BangPatterns
... | null | https://raw.githubusercontent.com/blitzcode/ray-marching-distance-fields/0578d01e75f819b1242fa1378e3963bd48842acc/QuadRendering.hs | haskell | Re-exports from GLHelpers
Module for efficient rendering of 2D quad primitives, used for UI elements and texture
mapped font rendering
TODO: We could speed this up quite a bit by using a geometry shader, significantly
reducing the amount of vertex and index data we have to generate and write
Shaders
Rende... |
# LANGUAGE RecordWildCards
, OverloadedStrings
, LambdaCase
, FlexibleContexts
, BangPatterns
, ScopedTypeVariables #
, OverloadedStrings
, LambdaCase
, FlexibleContexts
, BangPatterns
... |
87addaf17731b3d576aa0a120474732ded1473c3bd81a3a591791aeb3f590888 | hspec/hspec | BumpVersion.hs | module BumpVersion (main, Step(..), bumpVersion) where
import Control.Monad
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Data.List
import Data.Version
import Text.ParserCombinators.ReadP
import System.Environment (getArgs)
import S... | null | https://raw.githubusercontent.com/hspec/hspec/8ce7d2df846eb74f94f55587fab2cfa8abf81e92/util/BumpVersion.hs | haskell | module BumpVersion (main, Step(..), bumpVersion) where
import Control.Monad
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Data.List
import Data.Version
import Text.ParserCombinators.ReadP
import System.Environment (getArgs)
import S... | |
8c1782a3287dd2d870753bff99e3b73ca45a9e265d7f10121522d2303c08b5e0 | arne-schroppe/dash | Assembler.hs | module Language.Dash.Asm.Assembler (
assemble
, assembleWithEncodedConstTable
) where
import Data.Bits
import qualified Data.Sequence as Seq
import Language.Dash.Asm.DataAssembler
import Language.Dash.Limits
import Language.Dash.Error.Error
import ... | null | https://raw.githubusercontent.com/arne-schroppe/dash/82df755edc6555cba808539970ab6ff225c18b35/src/Language/Dash/Asm/Assembler.hs | haskell | Converts the nested list of functions into a flat list, and additionally provides
a map from indices in the nested list to the index in the flat list (that map is
just a sequence with the same length as the nested list). The map helps us to find
function references in the Opcode in our generated binary code.
an in... | module Language.Dash.Asm.Assembler (
assemble
, assembleWithEncodedConstTable
) where
import Data.Bits
import qualified Data.Sequence as Seq
import Language.Dash.Asm.DataAssembler
import Language.Dash.Limits
import Language.Dash.Error.Error
import ... |
61bf14998fcaa09024018f446e1743e2d700dc830a14019b22aaef428f32fa4f | AshleyYakeley/Truth | Grammar.hs | module Pinafore.Language.Grammar
( parseTopExpression
, parseModule
, parseType
, module I
) where
import Pinafore.Language.Grammar.Interpret as I (interpretImportDeclaration)
import Pinafore.Language.Grammar.Interpret
import Pinafore.Language.Grammar.Read as I
import Pinafore.Language.Grammar.Read... | null | https://raw.githubusercontent.com/AshleyYakeley/Truth/53900d89022f68bffb08d5c07b4e783ab0a0542e/Pinafore/pinafore-language/lib/Pinafore/Language/Grammar.hs | haskell | module Pinafore.Language.Grammar
( parseTopExpression
, parseModule
, parseType
, module I
) where
import Pinafore.Language.Grammar.Interpret as I (interpretImportDeclaration)
import Pinafore.Language.Grammar.Interpret
import Pinafore.Language.Grammar.Read as I
import Pinafore.Language.Grammar.Read... | |
f0821177c4af549b3fcc40e5ae31a9929a39719fc118a42eef1f2ae209f5450e | yapsterapp/er-cassandra | upsert.clj | (ns er-cassandra.model.upsert
(:require
[cats.core :refer [mlet return]]
[cats.context :refer [with-context]]
[cats.labs.manifold :refer [deferred-context]]
[prpr.promise :as promise :refer [ddo]]
[prpr.stream :as s]
[er-cassandra.model.model-session :as ms])
(:import
[er_cassandra.model.types ... | null | https://raw.githubusercontent.com/yapsterapp/er-cassandra/1d059f47bdf8654c7a4dd6f0759f1a114fdeba81/src/er_cassandra/model/upsert.clj | clojure | (ns er-cassandra.model.upsert
(:require
[cats.core :refer [mlet return]]
[cats.context :refer [with-context]]
[cats.labs.manifold :refer [deferred-context]]
[prpr.promise :as promise :refer [ddo]]
[prpr.stream :as s]
[er-cassandra.model.model-session :as ms])
(:import
[er_cassandra.model.types ... | |
f25b66fc564c20c94e26bd8f5c1bd2e403f580e494a3ebebeaf78e2baa7186a6 | ryukinix/leraxandria | huge-gcd.lisp | Enter your code here . Read input from STDIN . Print output to STDOUT
;; get product of n numbers given by A and product of m numbers given by B
print gcd(A , B ) % 10 ^ 9 + 7
(in-package :leraxandria/math)
(defun collect-numbers ()
(loop repeat (read)
collect (read)))
(defun product (numbers)
(reduc... | null | https://raw.githubusercontent.com/ryukinix/leraxandria/e8c4d1f6d1e88072fbd58dd6c48b5d80577f3b62/src/math/huge-gcd.lisp | lisp | get product of n numbers given by A and product of m numbers given by B | Enter your code here . Read input from STDIN . Print output to STDOUT
print gcd(A , B ) % 10 ^ 9 + 7
(in-package :leraxandria/math)
(defun collect-numbers ()
(loop repeat (read)
collect (read)))
(defun product (numbers)
(reduce #'* numbers))
(eval-when (:execute)
(defun main ()
(let ((a (produ... |
053411966ca2234fe93d33847a2325cfb09c13ed22bd39137e915a3a3eb7ec2f | jherrlin/guitar-theory-training | intervals.cljc | (ns se.jherrlin.music-theory.intervals)
(def perfect-unison 0)
(def root 0)
(def minor-second 1)
(def major-second 2)
(def augmented-second 3)
(def minor-third 3)
(def major-third 4)
(def augmented-third 5)
(def diminished-fourth 4)
(def perfect-fourth 5)
(def augm... | null | https://raw.githubusercontent.com/jherrlin/guitar-theory-training/54426b4d01f5cb74021b450c6cbcd32de4afd64f/src/se/jherrlin/music_theory/intervals.cljc | clojure | (ns se.jherrlin.music-theory.intervals)
(def perfect-unison 0)
(def root 0)
(def minor-second 1)
(def major-second 2)
(def augmented-second 3)
(def minor-third 3)
(def major-third 4)
(def augmented-third 5)
(def diminished-fourth 4)
(def perfect-fourth 5)
(def augm... | |
d6d57659b3561018c02a0a90c9694e9716446a1530b7fa0b59c1e346ba90ff43 | Helium4Haskell/helium | Thompson19.hs | fred :: Int -> Int
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/thompson/Thompson19.hs | haskell | fred :: Int -> Int
| |
c7d5ad5af709675b7b3268b5c58621d0cadd8c8a8437f2330048465efa2cbee7 | basho/riak_test | pr_pw.erl | -module(pr_pw).
-behavior(riak_test).
-export([confirm/0]).
-include_lib("eunit/include/eunit.hrl").
confirm() ->
application:start(inets),
lager:info("Deploy some nodes"),
Nodes = rt:build_cluster(4),
%% calculate the preflist for foo/bar
{ok, Ring} = rpc:call(hd(Nodes), riak_core_ring_manager,... | null | https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/tests/pr_pw.erl | erlang | calculate the preflist for foo/bar
connect to the only node in the preflist we won't break, to avoid
random put forwarding
check pr/pw can't be violated
install an intercept to emulate a node that kernel paniced or
downed node
we can still meet quorum, though
anymore
emulate another node failure
can't even me... | -module(pr_pw).
-behavior(riak_test).
-export([confirm/0]).
-include_lib("eunit/include/eunit.hrl").
confirm() ->
application:start(inets),
lager:info("Deploy some nodes"),
Nodes = rt:build_cluster(4),
{ok, Ring} = rpc:call(hd(Nodes), riak_core_ring_manager, get_my_ring, []),
UpNodes = rpc:call(... |
d23bacf6b2e6147f38038219cf634099b1f9f2f634cc05ef7f4a30579d160e14 | NorfairKing/smos | OptParse.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module Smos.Archive.OptParse
( module Smos.Archive.OptParse,
module Smos.Archive.OptParse.Types,
)
where
import Control.Arrow (left)
import Control.Monad.Logger
import Data.Maybe
import Data.Version
import qualified Env
import Options.Applicative... | null | https://raw.githubusercontent.com/NorfairKing/smos/82707699b446bc431f5233e5dc18c7ec3dd679fd/smos-archive/src/Smos/Archive/OptParse.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE RecordWildCards #
module Smos.Archive.OptParse
( module Smos.Archive.OptParse,
module Smos.Archive.OptParse.Types,
)
where
import Control.Arrow (left)
import Control.Monad.Logger
import Data.Maybe
import Data.Version
import qualified Env
import Options.Applicative
import Options.Applicative.Help.Pr... |
5dba2df8286023d22cba7ed2a9be3de675c25741bc13989bdef92304d5033f73 | egison/sweet-egison | deleteAs.hs | {-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE GADTs #-}
import Control.Egison
deleteWith m x xs =
match dfs xs (List m) [[mc| $hs ++ #x : $ts -> hs ++ ts |], [mc| _ -> xs |]]
main = do
print $ deleteWith ( List ) [ 1 , 2 ] [ [ 2 , 3 ] , [ 2 , 1 ] , [ 2 , 4 ] ] -- [ [ 2 , 3 ] , [ 2 , 1 ] , [... | null | https://raw.githubusercontent.com/egison/sweet-egison/fd3b392f9a2993bbc59d541b61f6641c7d193d6e/sample/deleteAs.hs | haskell | # LANGUAGE QuasiQuotes #
# LANGUAGE GADTs #
[ [ 2 , 3 ] , [ 2 , 1 ] , [ 2 , 4 ] ]
[ [ 2 , 3 ] , [ 2 , 4 ] ] |
import Control.Egison
deleteWith m x xs =
match dfs xs (List m) [[mc| $hs ++ #x : $ts -> hs ++ ts |], [mc| _ -> xs |]]
main = do
print $ deleteWith (List Eql)
([1, 2] :: [Int])
[ [ 2 , 3 ] , [ 2 , 1 ] , [ 2 , 4 ] ]
print $ deleteWith (Multiset Eql)
([1, 2] ... |
f2df5a47c1418776b101dfec740a8e18e85f35be62c769a9fa7236a822d8b904 | emqx/emqx | emqx_bridge_resource.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/9fb74bfc8735e579139ce744f84bb7b5e372ecf0/apps/emqx_bridge/src/emqx_bridge_resource.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_bridge_resource).
-include_lib("emqx/include/logger.hrl").
-export([
bridge_to... |
dd46a183401f80ae8dc4caffb58a29eff3ed4f97019b4a4862e05edd20d908b0 | CodyReichert/qi | hash.lisp | ;; -*- lisp -*-
(in-package :it.bese.arnesi)
;;;; * Convience functions for working with hash tables.
(defun build-hash-table (hash-spec inital-contents)
"Create a hash table containing ``INITAL-CONTENTS``."
(let ((ht (apply #'make-hash-table hash-spec)))
(dolist* ((key value) inital-contents)
(setf (g... | null | https://raw.githubusercontent.com/CodyReichert/qi/9cf6d31f40e19f4a7f60891ef7c8c0381ccac66f/dependencies/arnesi-master/src/hash.lisp | lisp | -*- lisp -*-
* Convience functions for working with hash tables.
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, t... |
(in-package :it.bese.arnesi)
(defun build-hash-table (hash-spec inital-contents)
"Create a hash table containing ``INITAL-CONTENTS``."
(let ((ht (apply #'make-hash-table hash-spec)))
(dolist* ((key value) inital-contents)
(setf (gethash key ht) value))
ht))
(defmacro deflookup-table
(name &key... |
08e3ec6bcc15f4e3722311586ecc107662eef5106c4ca4b19732d81b5be2b7c1 | ekmett/succinct | Partitioned.hs | # LANGUAGE CPP #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleContexts #
-----------------------------------------------------------------------------
-- |
Copyright : ( C ) 2013 - 15
-- License : BSD-style (see the file LICENSE)
Maintainer : < >
-- Stability : experimental
-- Portabi... | null | https://raw.githubusercontent.com/ekmett/succinct/7e884138c2e943f5ca08f56b58b409d08b870ab9/src/Succinct/Dictionary/Partitioned.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see the file LICENSE)
Stability : experimental
Portability : non-portable
---------------------------------------------------------------------------
| # LANGUAGE CPP #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleContexts #
Copyright : ( C ) 2013 - 15
Maintainer : < >
module Succinct.Dictionary.Partitioned
( Partitioned(..)
) where
#if __GLASGOW_HASKELL__ < 710
import Control.Applicative
import Data.Foldable
import Data.Monoid
import D... |
4acf9ae2fdfaa8057f4058fed200d0d3cd00fb43235303d98532bcf1404cb0d9 | okuoku/nausicaa | test-parser-tools-lexical-token.sps | -*- coding : utf-8 -*-
;;;
Part of : / Scheme
;;;Contents: tests for lexical token records
Date : Fri Oct 29 , 2010
;;;
;;;Abstract
;;;
;;;
;;;
Copyright ( c ) 2010 < >
;;;
;;;This program is free software: you can redistribute it and/or modify
;;;it under the terms of the GNU General Public License as publishe... | null | https://raw.githubusercontent.com/okuoku/nausicaa/50e7b4d4141ad4d81051588608677223fe9fb715/scheme/tests/test-parser-tools-lexical-token.sps | scheme |
Contents: tests for lexical token records
Abstract
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
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRA... | -*- coding : utf-8 -*-
Part of : / Scheme
Date : Fri Oct 29 , 2010
Copyright ( c ) 2010 < >
the Free Software Foundation , either version 3 of the License , or ( at
General Public License for more details .
You should have received a copy of the GNU General Public License
#!r6rs
(import (nausicaa)
(n... |
f151b3c44cf775e7e10c051dbb6d72e87ebb91915cca677dd32f54d0a05df4f1 | smallhadroncollider/taskell | List.hs | # LANGUAGE TemplateHaskell #
module Taskell.IO.HTTP.Trello.List
( List
, cards
, setCards
, listToList
) where
import ClassyPrelude
import Control.Lens (makeLenses, (&), (.~), (^.))
import Taskell.IO.HTTP.Aeson (deriveFromJSON)
import Taskell.IO.HTTP.Trello.Card (Card, cardToTask)
import ... | null | https://raw.githubusercontent.com/smallhadroncollider/taskell/3c731476e9a58ede300cfa83aba412509b132a3e/src/Taskell/IO/HTTP/Trello/List.hs | haskell | create lenses
operations | # LANGUAGE TemplateHaskell #
module Taskell.IO.HTTP.Trello.List
( List
, cards
, setCards
, listToList
) where
import ClassyPrelude
import Control.Lens (makeLenses, (&), (.~), (^.))
import Taskell.IO.HTTP.Aeson (deriveFromJSON)
import Taskell.IO.HTTP.Trello.Card (Card, cardToTask)
import ... |
75fde161b64156bbed7755460b6b513137f4c2e524bac56e075b2ba9f12c0e46 | mirage/irmin-watcher | irmin_watcher.mli | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) 2... | null | https://raw.githubusercontent.com/mirage/irmin-watcher/b2cf05dc3fd18e99f3cfe53c55b834d07e5775e4/src/irmin_watcher.mli | ocaml | * [stats ()] is a snapshot of [v]'s stats.
* [set_polling_time f] set the polling interval to [f]. Only valid when
[mode = `Polling]. | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) 2... |
118549c410410b122a4b00eb616ac7c1a641f80ae97840373c95ebb38eb9bf58 | ocsigen/ocaml-eliom | testmap.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocsigen/ocaml-eliom/497c6707f477cb3086dc6d8124384e74a8c379ae/testsuite/tests/lib-set/testmap.ml | ocaml | ************************************************************************
OCaml
... | , projet Gallium , INRIA Rocquencourt
Copyright 2012 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
module M = Map.Make(struct type t = int let compare (x:t) y = compare x y end)
let img x m = try Some(M.... |
d02bcd5261ed55e13317102af10cc664a3f92be6950856614eb77075f9aeceb4 | ocaml/oasis | test.ml | (******************************************************************************)
OASIS : architecture for building OCaml libraries and applications
(* *)
Copyright ( C ) 2011 - 2016 ,
Copyrig... | null | https://raw.githubusercontent.com/ocaml/oasis/3d1a9421db92a0882ebc58c5df219b18c1e5681d/examples/with-test/src/test.ml | ocaml | ****************************************************************************
This library is free software; you can redistribute it and/or modify it
under the t... | OASIS : architecture for building OCaml libraries and applications
Copyright ( C ) 2011 - 2016 ,
Copyright ( C ) 2008 - 2011 , OCamlCore SARL
the Free Software Foundation ; either version 2.1 of the License , or ( at
You s... |
4af0ede92ba76e8ac03f002af07acbebf9b2659c533bc80fbfb8c8037efe23db | jwarlander/everex | note_store_thrift.erl | %%
Autogenerated by Thrift Compiler ( 1.0.0 - dev )
%%
%% DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
%%
-module(note_store_thrift).
-behaviour(thrift_service).
-include("note_store_thrift.hrl").
-export([struct_info/1, function_info/2]).
struct_info(_) -> erlang:error(function_clause).
%%% ... | null | https://raw.githubusercontent.com/jwarlander/everex/559a18e45054abd7d2adfeb3ef060f79b58308e9/src/note_store_thrift.erl | erlang |
DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
interface
getSyncState(This, AuthenticationToken)
listNotebooks(This, AuthenticationToken)
listTags(This, AuthenticationToken)
createTag(This, AuthenticationToken, Tag)
updateTag(This, AuthenticationToken, Tag)
listSearches(This, Authentication... | Autogenerated by Thrift Compiler ( 1.0.0 - dev )
-module(note_store_thrift).
-behaviour(thrift_service).
-include("note_store_thrift.hrl").
-export([struct_info/1, function_info/2]).
struct_info(_) -> erlang:error(function_clause).
function_info('getSyncState', params_type) ->
{struct, [{1, string}]}
;
functio... |
c121daff1b1b52b59f22b6edaf168302ed93f6fe7f177f56f6413de209d3582f | exercism/scheme | example.scm |
(define (binary-search array target)
(let loop ((a 0) (b (1- (vector-length array))))
(if (> a b)
'not-found
(let ((m (ash (+ a b) -1)))
(cond
((< (vector-ref array m) target) (loop (1+ m) b))
((> (vector-ref array m) target) (loop a (1- m)))
(else m))))... | null | https://raw.githubusercontent.com/exercism/scheme/aa880e6222a393fcf5d672decb5c5dd6fae286ff/exercises/practice/binary-search/.meta/example.scm | scheme |
(define (binary-search array target)
(let loop ((a 0) (b (1- (vector-length array))))
(if (> a b)
'not-found
(let ((m (ash (+ a b) -1)))
(cond
((< (vector-ref array m) target) (loop (1+ m) b))
((> (vector-ref array m) target) (loop a (1- m)))
(else m))))... | |
8ca239abdf9c9d59dc661a95cfcd9cf94a9aa8b6a0c3f773419614b9f44171e0 | realworldocaml/book | test_sexp_prefix_quickcheck.ml | open! Core
open! Import
let round_trip_prefix prefix ~len ~parser_input ~verbose =
let prefix_signifier = Sexp_prefix.get_a_signifier prefix ~parser_input in
let suffix = String.drop_prefix parser_input len in
if verbose
then
print_s
[%message (prefix : Sexp_prefix.t) (prefix_signifier : string) (suf... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/parsexp/prefix/test/test_sexp_prefix_quickcheck.ml | ocaml | Check that a value is unchanged after we round-trip some prefix of its string
representation through [Prefix]. | open! Core
open! Import
let round_trip_prefix prefix ~len ~parser_input ~verbose =
let prefix_signifier = Sexp_prefix.get_a_signifier prefix ~parser_input in
let suffix = String.drop_prefix parser_input len in
if verbose
then
print_s
[%message (prefix : Sexp_prefix.t) (prefix_signifier : string) (suf... |
d5c6617facd4a045d9483f12ed03f38e1e60c5012631343cc357427be46e9c4a | wireapp/wire-server | Main.hs | -- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License... | null | https://raw.githubusercontent.com/wireapp/wire-server/3c7af9841f6bcb876b775951e1979e5493a8349a/services/brig/test/unit/Main.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
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 PARTI... | Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public License along
module Main
( main,
)
where
... |
edc3ff4e3c4a7316ea199510bd72471422134807ec9e7b86450ec28090768ef8 | clojure-android/lein-droid | project.clj | (defproject sample/sample "0.0.1-SNAPSHOT"
:description "Sample Android project to test lein-droid plugin."
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:global-vars {*warn-on-reflection* true}
:source-paths ["src/clojure" "src"]
:java-source-paths ["src/java"]
:javac-o... | null | https://raw.githubusercontent.com/clojure-android/lein-droid/1e0f8d5a5dd3c53232e21a1874867c212edb9848/sample/project.clj | clojure | [com.google.android.gms/play-services "7.0.0" :extension "aar"]
The above profiles can be specified in your profiles.clj and
contain machine-specific options such as {:android {:sdk-path
"/path/to/sdk"}}. :android-user profile is for global
The namespace of the app package - having a
different one for dev and rel... | (defproject sample/sample "0.0.1-SNAPSHOT"
:description "Sample Android project to test lein-droid plugin."
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:global-vars {*warn-on-reflection* true}
:source-paths ["src/clojure" "src"]
:java-source-paths ["src/java"]
:javac-o... |
bb7a99c367c7b795d02b810d885d9c569c1a4481fa5eb9dde93aba59236dc620 | ghc/testsuite | T8333.hs | # LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - omit - interface - pragmas #
main :: IO ()
main = return ()
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/th/T8333.hs | haskell | # LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - omit - interface - pragmas #
main :: IO ()
main = return ()
| |
341139e57f29708f453c3ecaa7ee8a7d20bafbedbdd7aee7f6a8f297d18f6c82 | danr/hipspec | Induction.hs | # LANGUAGE RecordWildCards , NamedFieldPuns , TypeOperators ,
ParallelListComp , ViewPatterns , ScopedTypeVariables #
ParallelListComp,ViewPatterns,ScopedTypeVariables #-}
module HipSpec.Induction (induction) where
-- TODO: Structural induction
Remember that Rename can be used as local sk... | null | https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/src/HipSpec/Induction.hs | haskell | TODO: Structural induction
Applying structural induction
If induction on these variables with this depth gives too many
obligations, then do not do this induction, return Nothing
Some parts give very many hypotheses. If this is the case,
Type signatures for skolemised variables
Hypotheses
Goal
Scope for trLite... | # LANGUAGE RecordWildCards , NamedFieldPuns , TypeOperators ,
ParallelListComp , ViewPatterns , ScopedTypeVariables #
ParallelListComp,ViewPatterns,ScopedTypeVariables #-}
module HipSpec.Induction (induction) where
Remember that Rename can be used as local skolems
import HipSpec.ThmLib
i... |
7795176b2ad2a37a12b0772dc75ec82a048ec6aa2c95b851eb0bbc701d6c7137 | lisp-korea/sicp | ex-2-2-byulparan.scm |
(define (square n)
(* n n))
(define (smallest-divisor n)
(define (divides? a b)
(= (remainder b a) 0))
(define (find-divisor n test-divisor)
(cond ((> (square test-divisor) n) n)
((divides? test-divisor n) test-divisor)
(else (find-divisor n (+ test-divisor 1)))))
(find-divisor n 2))
(define (p... | null | https://raw.githubusercontent.com/lisp-korea/sicp/4cdc1b1d858c6da7c9f4ec925ff4a724f36041cc/ch02/2.2/ex-2-2-byulparan.scm | scheme | accumulate map filter enumerate
(define (accumulate op initial sequence)
(if (null? sequence) initial
(op (car sequence)
(accumulate op initial (cdr sequence)))))
연습문제 2.34
(fold-left / 1 (list 1 2 3))
(fold-right / 1 (list 1 2 3))
fold-left 와 fold light 는 연산 순서가 달라진다.
but!
겹친 ... |
(define (square n)
(* n n))
(define (smallest-divisor n)
(define (divides? a b)
(= (remainder b a) 0))
(define (find-divisor n test-divisor)
(cond ((> (square test-divisor) n) n)
((divides? test-divisor n) test-divisor)
(else (find-divisor n (+ test-divisor 1)))))
(find-divisor n 2))
(define (p... |
b90931711a00688a1aac38cce2935582749c211726c2e38fb91664fef204d6c9 | ToBeReplaced/nio.file | file.clj | (ns org.tobereplaced.nio.file
"Wrapper for java.nio.file. All functions that accept a Path will be
coerced to a Path if possible. All functions that accept a
FileSystem will be coerced to a FileSystem if
possible. Additionally, all functions that accept a FileSystem can
accept no argument in exchange for the ... | null | https://raw.githubusercontent.com/ToBeReplaced/nio.file/c3aef2a712a82bd8c5eba4cd4756cc5d68d47fe7/src/org/tobereplaced/nio/file.clj | clojure |
Definition macros, to eliminate redundancy in function
definitions.
and PosixFilePermissions.
TODO: Implement FileSystems/newFileSystem as part of file-system
and add notes about being closeable.
Path functions, ordered lexicographically according to their
corresponding methods.
other clojure facilities.
... | (ns org.tobereplaced.nio.file
"Wrapper for java.nio.file. All functions that accept a Path will be
coerced to a Path if possible. All functions that accept a
FileSystem will be coerced to a FileSystem if
possible. Additionally, all functions that accept a FileSystem can
accept no argument in exchange for the ... |
78f2dd3855ac2ccc994d1d0b596a8db27393c742ab013b0f8a0e705417403ac7 | issuu/ocaml-protoc-plugin | field.ml | type t =
int32 , int64 , uint32 , uint64 , sint32 , sint64 , bool , enum
| Fixed_64_bit of Int64.t (* fixed64, sfixed64, double *)
| Length_delimited of {
offset : int;
length : int;
data : string;
} (* string, bytes, embedded messages, packed repeated fields *)
| Fixed_32_bit of Int32.t (... | null | https://raw.githubusercontent.com/issuu/ocaml-protoc-plugin/3d8b3eeb48e2a58dc80fbfdf9d749e69676625ab/src/ocaml_protoc_plugin/field.ml | ocaml | fixed64, sfixed64, double
string, bytes, embedded messages, packed repeated fields
fixed32, sfixed32, float | type t =
int32 , int64 , uint32 , uint64 , sint32 , sint64 , bool , enum
| Length_delimited of {
offset : int;
length : int;
data : string;
let varint v = Varint v
let fixed_32_bit v = Fixed_32_bit v
let fixed_64_bit v = Fixed_64_bit v
let length_delimited ?(offset=0) ?length data =
let length ... |
7efda79c3fcbe9fb4a15d8656d9f257bcfe51d7e1d0d695c49b3c9d23924c608 | fourmolu/fourmolu | op-chain-l-lt-four-out.hs | Left chain , 2 operators with p(a ) < p(b )
u :: Int
u =
1
+ 2
+ 3
+ 4
* 5
+ 6
+ 7
+ 8
| null | https://raw.githubusercontent.com/fourmolu/fourmolu/1f8903a92c8d5001dc1ec8ecfd4a04a3b61c3283/data/examples/declaration/value/function/infix/op-chain-l-lt-four-out.hs | haskell | Left chain , 2 operators with p(a ) < p(b )
u :: Int
u =
1
+ 2
+ 3
+ 4
* 5
+ 6
+ 7
+ 8
| |
50fcfe00d1c6456e22c94c00cb72b7efe676f108f7d27cc25fa993b3f4d125f6 | ix/lazyboy | Lazyboy.hs | module Lazyboy ( module Lazyboy.Control
, module Lazyboy.Types
, module Lazyboy.IO
, module Lazyboy.Constants
, module Control.Monad.Trans.RWS
) where
import Control.Monad.Trans.RWS
import Lazyboy.Constants
import ... | null | https://raw.githubusercontent.com/ix/lazyboy/83838f5e36906fe0262e9d53e6e692796f214e6b/src/Lazyboy.hs | haskell | module Lazyboy ( module Lazyboy.Control
, module Lazyboy.Types
, module Lazyboy.IO
, module Lazyboy.Constants
, module Control.Monad.Trans.RWS
) where
import Control.Monad.Trans.RWS
import Lazyboy.Constants
import ... | |
e492630a73089cc47367f8384af5e00c8b17dad69a52bf16fe83a19665fe3aeb | vrnithinkumar/ETC | etc_plug.erl | -module(etc_plug).
-export([init/1, do/1, format_error/1]).
-define(PROVIDER, etc_plug).
-define(DEPS, [app_discovery]).
PRINT
-ifndef(PRINT).
-define(PRINT(Var), io:format("DEBUG: ~p:~p - ~p~n~n ~p~n~n", [?MODULE, ?LINE, ??Var, Var])).
-endif.
%% ================================================================... | null | https://raw.githubusercontent.com/vrnithinkumar/ETC/5e5806975fe96a902dab830a0c8caadc5d61e62b/src/etc_plug.erl | erlang | ===================================================================
Public API
===================================================================
The 'user friendly' name of the task
The module implementation of the task
The task can be run by the user, always true
The list of dependencies
How to use the plugi... | -module(etc_plug).
-export([init/1, do/1, format_error/1]).
-define(PROVIDER, etc_plug).
-define(DEPS, [app_discovery]).
PRINT
-ifndef(PRINT).
-define(PRINT(Var), io:format("DEBUG: ~p:~p - ~p~n~n ~p~n~n", [?MODULE, ?LINE, ??Var, Var])).
-endif.
-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) -... |
9ac2ec3107e43ac9281a9ea8053ee757e9a9ce26daf3ccacbff8605377d61acc | synrc/fs | inotifywait_win32.erl | -module(inotifywait_win32).
-include("api.hrl").
-export([find_executable/0, start_port/2, known_events/0, line_to_event/1]).
find_executable() ->
fs:find_executable("inotifywait.exe", "deps/fs/priv/inotifywait.exe").
known_events() -> [created, modified, removed, renamed, undefined].
start_port(Path, Cwd) ->
... | null | https://raw.githubusercontent.com/synrc/fs/c6acf93e51a475c54dd20099112b1bb23ce160e6/src/sys/inotifywait_win32.erl | erlang | -module(inotifywait_win32).
-include("api.hrl").
-export([find_executable/0, start_port/2, known_events/0, line_to_event/1]).
find_executable() ->
fs:find_executable("inotifywait.exe", "deps/fs/priv/inotifywait.exe").
known_events() -> [created, modified, removed, renamed, undefined].
start_port(Path, Cwd) ->
... | |
40fba8ace44edefdd8bbe8edadb4a58abe543f555dd2c720c4859c53c70984da | FlowForwarding/LINC-Switch | linc_us4_oe_port_sup.erl | %%------------------------------------------------------------------------------
Copyright 2012 FlowForwarding.org
%%
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
%%... | null | https://raw.githubusercontent.com/FlowForwarding/LINC-Switch/9c28e7c8677c03440a62023292dd700fef0c3420/apps/linc_us4_oe/src/linc_us4_oe_port_sup.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, eithe... | Copyright 2012 FlowForwarding.org
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author Erlang Solutions Ltd. < >
2012 FlowForwarding.org
-module(linc_us4_oe_port_sup).
-behaviour(supervisor).
-export([start_link... |
adea5e704ddb46591e67b70d91d159d41a1346fb5888b9640397e7730b038d67 | craigl64/clim-ccl | transformations.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Package : CLIM - UTILS ; Base : 10 ; Lowercase : Yes -*-
;; See the file LICENSE for the full license governing this code.
;;
(in-package :clim-utils)
" Copyright ( c ) 1990 , 1991 , 1992 Symbolics , Inc. All rights reserved . "
;;; Generic Functions
(defgeneric... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/utils/transformations.lisp | lisp | Syntax : ANSI - Common - Lisp ; Package : CLIM - UTILS ; Base : 10 ; Lowercase : Yes -*-
See the file LICENSE for the full license governing this code.
Generic Functions
Transformations
--- Watch out, we define methods on this protocol class!
This class is not part of the advertised interface.
Translation transf... |
(in-package :clim-utils)
" Copyright ( c ) 1990 , 1991 , 1992 Symbolics , Inc. All rights reserved . "
(defgeneric compose-translation-with-transformation (transform dx dy))
(defgeneric compose-scaling-with-transformation (transform mx my &optional origin))
(defgeneric compose-rotation-with-transformation (transf... |
a45815ee5b02e4f0e220880c5850aa2ce9613bb85666441f9096fb9e19ecf527 | kseo/language-dart | Pretty.hs | module Language.Dart.Pretty
( Pretty
, prettyPrint
) where
import Data.Char (toLower)
import Data.List (partition)
import Text.PrettyPrint
import Text.Printf (printf)
import Language.Dart.Syntax
import Prelude hiding ((<>))
-- FIXME: Don't omit comments
prettyPrint :: Pretty a => a -> String
prettyPrint = sh... | null | https://raw.githubusercontent.com/kseo/language-dart/2349515a535b01cecd22fcbae73bf9ee763ee06d/src/Language/Dart/Pretty.hs | haskell | FIXME: Don't omit comments
FIXME: Handle configurations
FIXME: Show message
---------------------------------------------------------------------
-- Help functionality
Operator precedence of binary operators
-international.org/publications/files/ECMA-ST/ECMA-408.pdf | module Language.Dart.Pretty
( Pretty
, prettyPrint
) where
import Data.Char (toLower)
import Data.List (partition)
import Text.PrettyPrint
import Text.Printf (printf)
import Language.Dart.Syntax
import Prelude hiding ((<>))
prettyPrint :: Pretty a => a -> String
prettyPrint = show . pretty
parenPrec :: Int ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.