filterById :: List TripleCode -> List TripleCode
filterById = (codes) => {
_getNames = (out, _keys) => where(_keys) {
[] =>
out
[x, ...xs] =>
where(x.entry) {
Just({ channels, isDefault, name }) =>
_getNames(Set.insert(name, out), xs)
_ =>
_getNames(out, xs)
}
}
names = _getNames(Set.empty, codes)
_getDefaultOrLast = (out, _keys) => where(_keys) {
[] =>
out
[x, ...xs] =>
where(x.entry) {
Just({ channels, isDefault, name }) =>
if (isDefault) {
_getDefaultOrLast(Dict.insert(name, isDefault, out), xs)
} else if (
pipe(
Dict.get(name),
Maybe.fromMaybe(false),
)(out)
) {
_getDefaultOrLast(Dict.insert(name, false, out), xs)
} else {
_getDefaultOrLast(out, xs)
}
_ =>
_getDefaultOrLast(out, xs)
}
}
raw = _getDefaultOrLast(Dict.empty, codes)
IO.pTrace("RAWS", raw)
return codes
}
See the mad-literate.log above for the full context, but the relevant detail appears to be:
madlib: Function not found getNames
area: Area (Loc 2188 95 11) (Loc 2196 95 19)
ST: fromList
[ ( "/opt/homebrew/lib/node_modules/@madlib-lang/madlib/node_modules/binary-install/node_modules/.bin/prelude/__internal__/Maybe.mad_Maybe"
, Symbol
(ADTSymbol 1 2)
(ConstantOperand
Null
{ constantType =
PointerType
{ pointerReferent = IntegerType { typeBits = 8 }
, pointerAddrSpace = AddrSpace 0
}
})
)
What version of Madlib are you running?
0.27.1
How is Madlib installed on your system?
Installed via
npmWhat were you trying to do?
https://github.com/brekk/mad-literate/blob/7582b668912b9116d7e7c45b79e4e87e51cf48d3/src/CodeBoundary.mad#L81-L123 This code fails during LLVM code compilation
What did you expect to happen?
No error, or an error before runtime
What actually happened?
A big headache
mad-literate.log
Logs
See the mad-literate.log above for the full context, but the relevant detail appears to be:
madlib: Function not found getNames area: Area (Loc 2188 95 11) (Loc 2196 95 19) ST: fromList [ ( "/opt/homebrew/lib/node_modules/@madlib-lang/madlib/node_modules/binary-install/node_modules/.bin/prelude/__internal__/Maybe.mad_Maybe" , Symbol (ADTSymbol 1 2) (ConstantOperand Null { constantType = PointerType { pointerReferent = IntegerType { typeBits = 8 } , pointerAddrSpace = AddrSpace 0 } }) )Code Targets
LLVM
Environment details
No response