diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-08 04:24:03 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-08 04:24:03 -0400 |
| commit | f40c452eadac619d6e0c62b6aac9d86255d6318e (patch) | |
| tree | 076c7c76b8974ad2ec7eb6c74fcffaeda55ca40b | |
| parent | fdf838ccf3ae4ea973093b15f414059a218fe18a (diff) | |
| parent | 1311391cbf2d978d07bae679ae806e25f3388d92 (diff) | |
Merge branch 'joeyconfig'
2 files changed, 68 insertions, 0 deletions
diff --git a/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_4_1800ed279466eb210856e0bac8d46962._comment b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_4_1800ed279466eb210856e0bac8d46962._comment new file mode 100644 index 00000000..29d0e330 --- /dev/null +++ b/doc/todo/detect_and_use___96__GHC__95__PACKAGE__95__PATH__96__/comment_4_1800ed279466eb210856e0bac8d46962._comment @@ -0,0 +1,11 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 4""" + date="2016-03-08T07:28:59Z" + content=""" +How about this simple approch: If stack.yaml exists, have propellor use +stack for rebuilding itself. + +This assimes propellor doesn't ship a stack.yaml, which I think is ok. +The user can `stack init` to create one. +"""]] diff --git a/doc/todo/type_level_OS_requirements/comment_1_507e3b74c2a3b8f41da5d3eddf197c6f._comment b/doc/todo/type_level_OS_requirements/comment_1_507e3b74c2a3b8f41da5d3eddf197c6f._comment new file mode 100644 index 00000000..4d8cf06e --- /dev/null +++ b/doc/todo/type_level_OS_requirements/comment_1_507e3b74c2a3b8f41da5d3eddf197c6f._comment @@ -0,0 +1,57 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-03-08T07:31:51Z" + content=""" +ensureProperty presents a problem. Its type would become something like +this: + + ensureProperty :: Property NoInfo [OS] -> Propellor Result + +So, using ensureProperty inside a Property would not make the outer +Property inherit the OS requirements of the inner properties. + +I don't see a way to propigate the [OS] out to the outer Property +from the Propellor monad where ensureProperty is used. + +Hmm, perhaps the outer Property's [OS] could be reified and passed into +ensureProperty. Then reflect it back to a type, and require that inner +Property's [OS] contains everything in the outer [OS] list. + +I'm still vague on reifying and reflecting types, so I don't know if +this can be done in a way that lets the type checker detect errors. + +Something like this, maybe: + + foo :: Property NoInfo [Debian] + foo = property "foo" [Debian] $ do + os <- getOSList + ensureProperty os (Pkg.install "bar" :: Property NoInfo [FreeBSD]) + -- type error; FreeBSD not in [Debian] + +Where getOSList would pull the [Debian] out of Propellor monad +state. (Of course, ensureProperty could run getReifiedOSList itself, +`os` is only passed explicitly for illustration.) + +This would need `property` to lift its [OS] parameter to a type-level +list for the resulting `Property`. How? + +As for ensureProperty, something like this could work for the +implementation, if I understand reify right: + + ensureProperty :: [OS] -> Property Noinfo -> Propellor Result + ensureProperty outeros p@(Property NoInfo inneros) + | checkUnification (reify inneros) (reify outeros) = do + ... + | otherwise = error "type checker should never let this be reached" + + checkUnification + :: (Reifies s1 t1, Reifies s2 t2, TypesUnify t1 t2) + => proxy1 s1 + -> proxy2 s2 + -> Bool + checkUnification _ _ = True -- all done at type level + + type family TypesUnify t1 t2 + ... +"""]] |
