-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added workflows and reformatted code. (#1)
- Loading branch information
1 parent
cc2fb67
commit b83ca74
Showing
14 changed files
with
493 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: main arm64 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
workflow_dispatch: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
call-workflow: | ||
uses: layer-3-communications/.github/.github/workflows/build-haskell.yaml@main | ||
with: | ||
build-arch: arm64 | ||
slack-name: ${{ github.ref_name }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: pull request arm64 | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
call-workflow: | ||
uses: layer-3-communications/.github/.github/workflows/build-haskell.yaml@main | ||
with: | ||
build-arch: arm64 | ||
slack-name: ${{ github.event.pull_request.head.ref }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: main x64 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
workflow_dispatch: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
call-workflow: | ||
uses: layer-3-communications/.github/.github/workflows/build-haskell.yaml@main | ||
with: | ||
build-arch: x64 | ||
slack-name: ${{ github.ref_name }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: pull request x64 | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
call-workflow: | ||
uses: layer-3-communications/.github/.github/workflows/build-haskell.yaml@main | ||
with: | ||
build-arch: x64 | ||
slack-name: ${{ github.event.pull_request.head.ref }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.vscode/ | ||
dist | ||
dist-* | ||
cabal-dev | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,41 @@ | ||
{-# language OverloadedStrings #-} | ||
{-# LANGUAGE OverloadedStrings #-} | ||
|
||
import Control.Exception (bracket,throwIO) | ||
import Control.Exception (bracket, throwIO) | ||
import Http.Exchange.Network (exchange) | ||
import Http.Types (Request(..),RequestLine(..),Bodied(..),Header(Header)) | ||
import Http.Headers qualified as Headers | ||
import Http.Types (Bodied (..), Header (Header), Request (..), RequestLine (..)) | ||
import Network.Socket qualified as N | ||
import Text.Show.Pretty (pPrint) | ||
import qualified Http.Headers as Headers | ||
import qualified Network.Socket as N | ||
|
||
main :: IO () | ||
main = do | ||
let hints = N.defaultHints { N.addrSocketType = N.Stream } | ||
let hints = N.defaultHints {N.addrSocketType = N.Stream} | ||
minfo <- N.getAddrInfo (Just hints) (Just "ifconfig.me") (Just "80") | ||
info <- case minfo of | ||
info : _ -> pure info | ||
[] -> fail "Impossible: getAddrInfo cannot return empty list" | ||
bracket (N.openSocket info) N.close $ \sock -> do | ||
N.connect sock (N.addrAddress info) | ||
result <- exchange sock Bodied | ||
{ metadata = Request | ||
{ requestLine = RequestLine | ||
{ method = "GET" | ||
, path = "/ip" | ||
result <- | ||
exchange | ||
sock | ||
Bodied | ||
{ metadata = | ||
Request | ||
{ requestLine = | ||
RequestLine | ||
{ method = "GET" | ||
, path = "/ip" | ||
} | ||
, headers = | ||
Headers.fromList | ||
[ Header "Host" "ifconfig.me" | ||
, Header "Accept" "text/plain" | ||
, Header "User-Agent" "curl/0.0.0" | ||
] | ||
} | ||
, body = mempty | ||
} | ||
, headers = Headers.fromList | ||
[ Header "Host" "ifconfig.me" | ||
, Header "Accept" "text/plain" | ||
, Header "User-Agent" "curl/0.0.0" | ||
] | ||
} | ||
, body = mempty | ||
} | ||
case result of | ||
Left e -> throwIO e | ||
Right resp -> pPrint resp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Number of spaces per indentation step | ||
indentation: 2 | ||
|
||
# Max line length for automatic line breaking | ||
column-limit: 200 | ||
|
||
# Styling of arrows in type signatures (choices: trailing, leading, or leading-args) | ||
function-arrows: trailing | ||
|
||
# How to place commas in multi-line lists, records, etc. (choices: leading or trailing) | ||
comma-style: leading | ||
|
||
# Styling of import/export lists (choices: leading, trailing, or diff-friendly) | ||
import-export-style: leading | ||
|
||
# Whether to full-indent or half-indent 'where' bindings past the preceding body | ||
indent-wheres: false | ||
|
||
# Whether to leave a space before an opening record brace | ||
record-brace-space: true | ||
|
||
# Number of spaces between top-level declarations | ||
newlines-between-decls: 1 | ||
|
||
# How to print Haddock comments (choices: single-line, multi-line, or multi-line-compact) | ||
haddock-style: multi-line | ||
|
||
# How to print module docstring | ||
haddock-style-module: null | ||
|
||
# Styling of let blocks (choices: auto, inline, newline, or mixed) | ||
let-style: auto | ||
|
||
# How to align the 'in' keyword with respect to the 'let' keyword (choices: left-align, right-align, or no-space) | ||
in-style: right-align | ||
|
||
# Whether to put parentheses around a single constraint (choices: auto, always, or never) | ||
single-constraint-parens: always | ||
|
||
# Output Unicode syntax (choices: detect, always, or never) | ||
unicode: never | ||
|
||
# Give the programmer more choice on where to insert blank lines | ||
respectful: true | ||
|
||
# Fixity information for operators | ||
fixities: [] | ||
|
||
# Module reexports Fourmolu should know about | ||
reexports: [] | ||
|
Oops, something went wrong.