A point of interest, not mentioned in the article, is that loperamide is actually an opioid. All opioids cause some degree of constipation, hence why loperamide helps with diarrhea. Loperamide is unusual, in that it doesn't cross the blood-brain barrier, hence why taking it doesn't get you high.