Compare commits
7 Commits
2f34fc7bef
...
faf4f3b7ca
Author | SHA1 | Date |
---|---|---|
Julian Ospald | faf4f3b7ca | |
Julian Ospald | d888d11d59 | |
Julian Ospald | 28a1077833 | |
Julian Ospald | c40b9dbc0b | |
Julian Ospald | 6bbd262818 | |
Julian Ospald | 78d36bce24 | |
Julian Ospald | aedfc19220 |
18
.travis.yml
18
.travis.yml
|
@ -4,29 +4,11 @@ jobs:
|
|||
osx_image: xcode10.1
|
||||
language: generic
|
||||
env: ARTIFACT=x86_64-apple-darwin-10.13-ghcup
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- curl
|
||||
- libffi
|
||||
- libiconv
|
||||
- make
|
||||
- ncurses
|
||||
- xz
|
||||
|
||||
- os: osx
|
||||
osx_image: xcode11.3
|
||||
language: generic
|
||||
env: ARTIFACT=x86_64-apple-darwin-10.14-ghcup
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- curl
|
||||
- libffi
|
||||
- libiconv
|
||||
- make
|
||||
- ncurses
|
||||
- xz
|
||||
|
||||
script: ".travis/build.sh"
|
||||
|
||||
|
|
18
HACKING.md
18
HACKING.md
|
@ -16,7 +16,23 @@ I consider haskell-TLS an interesting experiment, but not a battle-tested and pe
|
|||
|
||||
### Optics instead of lens
|
||||
|
||||
They're a little safer (less Monoid weirdness with view) and have better error messages. Consider: `view (_Just . to (++ "abc")) Nothing` (lens) vs `view (_Just % to (++ "abc")) Nothing` (optics). The latter does not compile (good).
|
||||
They're a little safer (less Monoid weirdness with view) and have better error messages. Consider the following wit lens
|
||||
|
||||
```
|
||||
> view (_Just . to (++ "abc")) Nothing
|
||||
""
|
||||
```
|
||||
|
||||
vs optics
|
||||
|
||||
```
|
||||
view (_Just % to (++ "abc")) Nothing
|
||||
|
||||
<interactive>:2:1: error:
|
||||
• An_AffineFold cannot be used as A_Getter
|
||||
• In the expression: view (_Just % to (++ "abc")) Nothing
|
||||
In an equation for ‘it’: it = view (_Just % to (++ "abc")) Nothing
|
||||
```
|
||||
|
||||
### Strict and StrictData on by default
|
||||
|
||||
|
|
22
TODO.md
22
TODO.md
|
@ -2,23 +2,10 @@
|
|||
|
||||
## Now
|
||||
|
||||
* travis
|
||||
* ghcup migration
|
||||
* update static links
|
||||
|
||||
* requirements
|
||||
* for ghcup (bootstrap script)
|
||||
* per tool
|
||||
* mac build: xattr -cr .
|
||||
* static binaries
|
||||
* upgrade plan from old ghcup
|
||||
|
||||
* bootstrap-haskell with new ghcup
|
||||
* add warning to ghcup script about new binary
|
||||
|
||||
* make sure smart-dl is not broken
|
||||
|
||||
* handle SIGINT better (remove dirs)
|
||||
|
||||
* review symlink handling (maybe fixed set of tools?)
|
||||
* releases, update download info and bootstrap-haskell
|
||||
|
||||
## Maybe
|
||||
|
||||
|
@ -28,16 +15,17 @@
|
|||
|
||||
## Later
|
||||
|
||||
* i386 support
|
||||
* add support for RC/alpha/HEAD versions
|
||||
|
||||
## Cleanups
|
||||
|
||||
* too many decodeutf8
|
||||
* avoid alternative for IO
|
||||
* use plucky or oops instead of Excepts
|
||||
|
||||
## Questions
|
||||
|
||||
* fully static musl builds for linux?
|
||||
* mirror support
|
||||
* interactive handling when distro doesn't exist and we know the tarball is incompatible?
|
||||
* ghcup-with wrapper to execute a command with a given ghc in PATH?
|
||||
|
|
|
@ -984,6 +984,13 @@ cabal_3200_64_darwin = DownloadInfo
|
|||
-------------
|
||||
|
||||
|
||||
ghcup_010_32_linux :: DownloadInfo
|
||||
ghcup_010_32_linux = DownloadInfo
|
||||
[uri|https://github.com/hasufell/ghcup-hs/releases/download/v0.1.0/i386-linux-ghcup-0.1.0|]
|
||||
Nothing
|
||||
"ce95fd3044ea249c2ea02e122112a787d710cc4be2dcf1e78d8c68b540a70920"
|
||||
|
||||
|
||||
ghcup_010_64_linux :: DownloadInfo
|
||||
ghcup_010_64_linux = DownloadInfo
|
||||
[uri|https://github.com/hasufell/ghcup-hs/releases/download/v0.1.0/x86_64-linux-ghcup-0.1.0|]
|
||||
|
@ -1009,7 +1016,7 @@ ghcup_010_64_darwin10_14 :: DownloadInfo
|
|||
ghcup_010_64_darwin10_14 = DownloadInfo
|
||||
[uri|https://github.com/hasufell/ghcup-hs/releases/download/v0.1.0/x86_64-apple-darwin-10.14-ghcup-0.1.0|]
|
||||
Nothing
|
||||
"6ad7824af3f03bd01e6367de105c2522916d3672a8cdce3f09c3b772f19c9bc8"
|
||||
"1f151e308622cfd010549bfb7ac06659794995f6c0a0eeb3ed14eed34573e237"
|
||||
|
||||
|
||||
|
||||
|
@ -1892,6 +1899,10 @@ ghcupDownloads = M.fromList
|
|||
, (FreeBSD, M.fromList [(Nothing, ghcup_010_64_freebsd)])
|
||||
]
|
||||
)
|
||||
, ( A_32
|
||||
, M.fromList
|
||||
[(Linux UnknownLinux, M.fromList [(Nothing, ghcup_010_32_linux)])]
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE DuplicateRecordFields #-}
|
||||
{-# LANGUAGE NamedFieldPuns #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
|
||||
|
||||
module Main where
|
||||
|
@ -14,7 +15,7 @@ import GHCup.Types.JSON ( )
|
|||
import GHCup.Utils.Logger
|
||||
import GHCupInfo
|
||||
|
||||
import Data.Aeson ( eitherDecode )
|
||||
import Data.Aeson ( eitherDecode, encode )
|
||||
import Data.Aeson.Encode.Pretty
|
||||
#if !MIN_VERSION_base(4,13,0)
|
||||
import Data.Semigroup ( (<>) )
|
||||
|
@ -61,10 +62,13 @@ outputP = fileOutput <|> stdOutput
|
|||
|
||||
data GenJSONOpts = GenJSONOpts
|
||||
{ output :: Maybe Output
|
||||
, pretty :: Bool
|
||||
}
|
||||
|
||||
genJSONOpts :: Parser GenJSONOpts
|
||||
genJSONOpts = GenJSONOpts <$> optional outputP
|
||||
genJSONOpts = GenJSONOpts <$> optional outputP <*> switch
|
||||
(short 'p' <> long "pretty" <> help "Make JSON output pretty (human readable)"
|
||||
)
|
||||
|
||||
|
||||
data Input
|
||||
|
@ -134,14 +138,16 @@ main = do
|
|||
customExecParser (prefs showHelpOnError) (info (opts <**> helper) idm)
|
||||
>>= \Options {..} -> case optCommand of
|
||||
GenJSON gopts -> do
|
||||
let
|
||||
bs = encodePretty' (defConfig { confIndent = Spaces 2 })
|
||||
ghcupInfo
|
||||
let bs True =
|
||||
encodePretty' (defConfig { confIndent = Spaces 2 }) ghcupInfo
|
||||
bs False = encode ghcupInfo
|
||||
case gopts of
|
||||
GenJSONOpts { output = Nothing } -> L.hPutStr stdout bs
|
||||
GenJSONOpts { output = Just StdOutput } -> L.hPutStr stdout bs
|
||||
GenJSONOpts { output = Just (FileOutput file) } ->
|
||||
L.writeFile file bs
|
||||
GenJSONOpts { output = Nothing, pretty } ->
|
||||
L.hPutStr stdout (bs pretty)
|
||||
GenJSONOpts { output = Just StdOutput, pretty } ->
|
||||
L.hPutStr stdout (bs pretty)
|
||||
GenJSONOpts { output = Just (FileOutput file), pretty } ->
|
||||
L.writeFile file (bs pretty)
|
||||
ValidateJSON vopts -> case vopts of
|
||||
ValidateJSONOpts { input = Nothing } ->
|
||||
L.getContents >>= valAndExit validate
|
||||
|
@ -165,4 +171,3 @@ main = do
|
|||
Left e -> die (color Red $ show e)
|
||||
myLoggerT (LoggerConfig True (B.hPut stdout) (\_ -> pure ())) (f av)
|
||||
>>= exitWith
|
||||
|
||||
|
|
|
@ -27,24 +27,41 @@ download_ghcup() {
|
|||
_plat="$(uname -s)"
|
||||
_arch=$(uname -m)
|
||||
|
||||
case "${_arch}" in
|
||||
x86_64|amd64)
|
||||
;;
|
||||
i*86)
|
||||
die "i386 currently not supported!"
|
||||
;;
|
||||
*) die "Unknown architecture: ${_arch}"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${_plat}" in
|
||||
"linux"|"Linux")
|
||||
_url=https://www.haskell.org/ghcup/bin/x86_64-linux-ghcup
|
||||
case "${_arch}" in
|
||||
x86_64|amd64)
|
||||
_url=https://www.haskell.org/ghcup/bin/x86_64-linux-ghcup
|
||||
;;
|
||||
i*86)
|
||||
_url=https://www.haskell.org/ghcup/bin/i386-linux-ghcup
|
||||
;;
|
||||
*) die "Unknown architecture: ${_arch}"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"FreeBSD"|"freebsd")
|
||||
case "${_arch}" in
|
||||
x86_64|amd64)
|
||||
;;
|
||||
i*86)
|
||||
die "i386 currently not supported!"
|
||||
;;
|
||||
*) die "Unknown architecture: ${_arch}"
|
||||
;;
|
||||
esac
|
||||
_url=https://www.haskell.org/ghcup/bin/x86_64-portbld-freebsd-ghcup
|
||||
;;
|
||||
"Darwin"|"darwin")
|
||||
case "${_arch}" in
|
||||
x86_64|amd64)
|
||||
;;
|
||||
i*86)
|
||||
die "i386 currently not supported!"
|
||||
;;
|
||||
*) die "Unknown architecture: ${_arch}"
|
||||
;;
|
||||
esac
|
||||
case "$(sw_vers -productVersion || echo "none")" in
|
||||
10.15.*) _url=https://www.haskell.org/ghcup/bin/x86_64-apple-darwin-10.14-ghcup ;;
|
||||
10.14.*) _url=https://www.haskell.org/ghcup/bin/x86_64-apple-darwin-10.14-ghcup ;;
|
||||
|
|
2166
ghcup-0.0.1.json
2166
ghcup-0.0.1.json
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue